Render markdown in snippets
Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
This commit is contained in:
parent
436e96467d
commit
3bdf930852
1 changed files with 13 additions and 4 deletions
|
@ -8,9 +8,18 @@
|
|||
= 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 "Raw", raw_snippet_path(@snippet), class: "btn btn-tiny", target: "_blank"
|
||||
.file-content.code
|
||||
- unless @snippet.content.empty?
|
||||
%div{class: user_color_scheme_class}
|
||||
= raw @snippet.colorize(formatter: :gitlab)
|
||||
- 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}
|
||||
= raw @snippet.colorize(formatter: :gitlab)
|
||||
- else
|
||||
.file-content.code
|
||||
%p.nothing_here_message Empty file
|
||||
|
|
Loading…
Reference in a new issue