diff options
author | Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com> | 2013-11-20 19:29:50 +0400 |
---|---|---|
committer | Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com> | 2013-11-20 19:29:50 +0400 |
commit | 3bdf930852094169a5ea522b7b3cbf4f20a66027 (patch) | |
tree | 893100f16c33f68a593dbadacba3aa902c0596fc /app | |
parent | 436e96467dba5ccbaa5ffef21f760f6441fe8a0f (diff) |
Render markdown in snippets
Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
Diffstat (limited to 'app')
-rw-r--r-- | app/views/snippets/_blob.html.haml | 17 |
1 files changed, 13 insertions, 4 deletions
diff --git a/app/views/snippets/_blob.html.haml b/app/views/snippets/_blob.html.haml index c2e0d97a117..dc856f84be9 100644 --- a/app/views/snippets/_blob.html.haml +++ b/app/views/snippets/_blob.html.haml @@ -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 |