Dont render README with markup if format is not compatible
Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
This commit is contained in:
parent
0377069841
commit
d6c037de81
4 changed files with 8 additions and 4 deletions
|
@ -217,4 +217,8 @@ module ApplicationHelper
|
|||
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}
|
||||
|
|
Loading…
Reference in a new issue