Commit d6c037de authored by Dmitriy Zaporozhets's avatar Dmitriy Zaporozhets

Dont render README with markup if format is not compatible

Signed-off-by: default avatarDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
parent 03770698
...@@ -217,4 +217,8 @@ module ApplicationHelper ...@@ -217,4 +217,8 @@ module ApplicationHelper
haml_tag :script, "$('." + html_class + "').timeago().tooltip()" haml_tag :script, "$('." + html_class + "').timeago().tooltip()"
end.html_safe end.html_safe
end end
def render_markup(file_name, file_content)
GitHub::Markup.render(file_name, file_content).html_safe
end
end end
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
= markdown(blob.data) = markdown(blob.data)
- elsif markup?(blob.name) - elsif markup?(blob.name)
.file-content.wiki .file-content.wiki
= raw GitHub::Markup.render(blob.name, blob.data) = render_markup(blob.name, blob.data)
- else - else
.file-content.code .file-content.code
- unless blob.empty? - unless blob.empty?
......
...@@ -9,5 +9,5 @@ ...@@ -9,5 +9,5 @@
- elsif plain_text_readme?(readme.name) - elsif plain_text_readme?(readme.name)
%pre.clean %pre.clean
= readme.data = readme.data
- else - elsif markup?(readme.name)
= raw GitHub::Markup.render(readme.name, readme.data) = render_markup(readme.name, readme.data)
...@@ -15,7 +15,7 @@ ...@@ -15,7 +15,7 @@
= markdown(@snippet.data) = markdown(@snippet.data)
- elsif markup?(@snippet.file_name) - elsif markup?(@snippet.file_name)
.file-content.wiki .file-content.wiki
= raw GitHub::Markup.render(@snippet.file_name, @snippet.data) = render_markup(@snippet.file_name, @snippet.data)
- else - else
.file-content.code .file-content.code
%div{class: user_color_scheme_class} %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