Commit 3bdf9308 authored by Dmitriy Zaporozhets's avatar Dmitriy Zaporozhets

Render markdown in snippets

Signed-off-by: default avatarDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
parent 436e9646
...@@ -8,9 +8,18 @@ ...@@ -8,9 +8,18 @@
= link_to "Edit", edit_snippet_path(@snippet), class: "btn btn-tiny", title: 'Edit Snippet' = link_to "Edit", edit_snippet_path(@snippet), class: "btn btn-tiny", title: 'Edit Snippet'
= link_to "Delete", snippet_path(@snippet), method: :delete, confirm: "Are you sure?", class: "btn btn-tiny", title: 'Delete Snippet' = link_to "Delete", snippet_path(@snippet), method: :delete, confirm: "Are you sure?", class: "btn btn-tiny", title: 'Delete Snippet'
= link_to "Raw", raw_snippet_path(@snippet), class: "btn btn-tiny", target: "_blank" = link_to "Raw", raw_snippet_path(@snippet), class: "btn btn-tiny", target: "_blank"
.file-content.code
- unless @snippet.content.empty? - unless @snippet.content.empty?
- if gitlab_markdown?(@snippet.file_name)
.file-content.wiki
= preserve do
= markdown(@snippet.data)
- elsif markup?(@snippet.file_name)
.file-content.wiki
= raw GitHub::Markup.render(@snippet.file_name, @snippet.data)
- else
.file-content.code
%div{class: user_color_scheme_class} %div{class: user_color_scheme_class}
= raw @snippet.colorize(formatter: :gitlab) = raw @snippet.colorize(formatter: :gitlab)
- else - else
.file-content.code
%p.nothing_here_message Empty file %p.nothing_here_message Empty file
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment