Commit d6c037de81096680db07397a44a0824355c703c8
1 parent
03770698
Exists in
spb-stable
and in
3 other branches
Dont render README with markup if format is not compatible
Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
Showing
4 changed files
with
8 additions
and
4 deletions
Show diff stats
app/helpers/application_helper.rb
... | ... | @@ -217,4 +217,8 @@ module ApplicationHelper |
217 | 217 | haml_tag :script, "$('." + html_class + "').timeago().tooltip()" |
218 | 218 | end.html_safe |
219 | 219 | end |
220 | + | |
221 | + def render_markup(file_name, file_content) | |
222 | + GitHub::Markup.render(file_name, file_content).html_safe | |
223 | + end | |
220 | 224 | end | ... | ... |
app/views/projects/blob/_text.html.haml
app/views/projects/tree/_readme.html.haml
app/views/snippets/_blob.html.haml
... | ... | @@ -15,7 +15,7 @@ |
15 | 15 | = markdown(@snippet.data) |
16 | 16 | - elsif markup?(@snippet.file_name) |
17 | 17 | .file-content.wiki |
18 | - = raw GitHub::Markup.render(@snippet.file_name, @snippet.data) | |
18 | + = render_markup(@snippet.file_name, @snippet.data) | |
19 | 19 | - else |
20 | 20 | .file-content.code |
21 | 21 | %div{class: user_color_scheme_class} | ... | ... |