summaryrefslogtreecommitdiff
path: root/app/helpers
diff options
context:
space:
mode:
authorDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>2015-07-09 11:36:09 +0200
committerDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>2015-07-09 11:36:09 +0200
commit1bf3e1578abf41d937a2bf8e2512e0174ed0a4b4 (patch)
tree73d781b23380cac46a1d7e643e5b1e235b769474 /app/helpers
parent3cdd68475f80c43371610c981b41cd3dc87e3300 (diff)
downloadgitlab-ce-1bf3e1578abf41d937a2bf8e2512e0174ed0a4b4.tar.gz
Properly render plain readme
Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
Diffstat (limited to 'app/helpers')
-rw-r--r--app/helpers/application_helper.rb8
1 files changed, 8 insertions, 0 deletions
diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb
index 0b46db4b1c3..a803b66c502 100644
--- a/app/helpers/application_helper.rb
+++ b/app/helpers/application_helper.rb
@@ -213,6 +213,10 @@ module ApplicationHelper
Haml::Helpers.preserve(markdown(file_content))
elsif asciidoc?(file_name)
asciidoc(file_content)
+ elsif plain?(file_name)
+ content_tag :pre, class: 'plain-readme' do
+ file_content
+ end
else
GitHub::Markup.render(file_name, file_content).
force_encoding(file_content.encoding).html_safe
@@ -221,6 +225,10 @@ module ApplicationHelper
simple_format(file_content)
end
+ def plain?(filename)
+ Gitlab::MarkupHelper.plain?(filename)
+ end
+
def markup?(filename)
Gitlab::MarkupHelper.markup?(filename)
end