Commit 0e524aae authored by Dmitriy Zaporozhets's avatar Dmitriy Zaporozhets

Added workaround for github-markup issue with rendering markdown

parent ed899a2f
...@@ -32,7 +32,11 @@ module TreeHelper ...@@ -32,7 +32,11 @@ module TreeHelper
# #
# Returns boolean # Returns boolean
def markup?(filename) def markup?(filename)
filename.end_with?(*%w(.mdown .md .markdown .textile .rdoc .org .creole filename.end_with?(*%w(.textile .rdoc .org .creole
.mediawiki .rst .asciidoc .pod)) .mediawiki .rst .asciidoc .pod))
end
def gitlab_markdown?(filename)
filename.end_with?(*%w(.mdown .md .markdown))
end end
end end
...@@ -43,7 +43,11 @@ ...@@ -43,7 +43,11 @@
%i.icon-file %i.icon-file
= content.name = content.name
.file_content.wiki .file_content.wiki
= raw GitHub::Markup.render(content.name, content.data) - if gitlab_markdown?(content.name)
= preserve do
= markdown(content.data)
- else
= raw GitHub::Markup.render(content.name, content.data)
:javascript :javascript
$(function(){ $(function(){
......
...@@ -9,7 +9,11 @@ ...@@ -9,7 +9,11 @@
= link_to "history", project_commits_path(@project, path: params[:path], ref: @ref), class: "btn very_small" = link_to "history", project_commits_path(@project, path: params[:path], ref: @ref), class: "btn very_small"
= link_to "blame", blame_file_project_ref_path(@project, @ref, path: params[:path]), class: "btn very_small" = link_to "blame", blame_file_project_ref_path(@project, @ref, path: params[:path]), class: "btn very_small"
- if file.text? - if file.text?
- if markup?(name) - if gitlab_markdown?(name)
.file_content.wiki
= preserve do
= markdown(file.data)
- elsif markup?(name)
.file_content.wiki .file_content.wiki
= raw GitHub::Markup.render(name, file.data) = raw GitHub::Markup.render(name, file.data)
- else - else
......
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