Commit c307fd22 authored by Dmitriy Zaporozhets's avatar Dmitriy Zaporozhets
Browse files

Merge branch 'xss/readme' of /home/git/repositories/gitlab/gitlabhq

......@@ -217,4 +217,8 @@ def time_ago_with_tooltip(date, placement = 'top', html_class = 'time_ago')
haml_tag :script, "$('." + html_class + "').timeago().tooltip()"
end.html_safe
end
def render_markup(file_name, file_content)
GitHub::Markup.render(file_name, file_content).html_safe
end
end
......@@ -4,7 +4,7 @@
= markdown(blob.data)
- elsif markup?(blob.name)
.file-content.wiki
= raw GitHub::Markup.render(blob.name, blob.data)
= render_markup(blob.name, blob.data)
- else
.file-content.code
- unless blob.empty?
......
......@@ -9,5 +9,5 @@
- elsif plain_text_readme?(readme.name)
%pre.clean
= readme.data
- else
= raw GitHub::Markup.render(readme.name, readme.data)
- elsif markup?(readme.name)
= render_markup(readme.name, readme.data)
......@@ -15,7 +15,7 @@
= markdown(@snippet.data)
- elsif markup?(@snippet.file_name)
.file-content.wiki
= raw GitHub::Markup.render(@snippet.file_name, @snippet.data)
= render_markup(@snippet.file_name, @snippet.data)
- else
.file-content.code
%div{class: user_color_scheme_class}
......
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