Commit 3b40781e authored by Vasiliy Yakliushin's avatar Vasiliy Yakliushin

Extract plain file rendering into a separate method

parent 22e2217c
...@@ -154,9 +154,7 @@ module MarkupHelper ...@@ -154,9 +154,7 @@ module MarkupHelper
elsif asciidoc?(file_name) elsif asciidoc?(file_name)
asciidoc_unsafe(text, context) asciidoc_unsafe(text, context)
elsif plain?(file_name) elsif plain?(file_name)
content_tag :pre, class: 'plain-readme' do plain_unsafe(text)
text
end
else else
other_markup_unsafe(file_name, text, context) other_markup_unsafe(file_name, text, context)
end end
...@@ -271,6 +269,12 @@ module MarkupHelper ...@@ -271,6 +269,12 @@ module MarkupHelper
Gitlab::Asciidoc.render(text, context) Gitlab::Asciidoc.render(text, context)
end end
def plain_unsafe(text)
content_tag :pre, class: 'plain-readme' do
text
end
end
def other_markup_unsafe(file_name, text, context = {}) def other_markup_unsafe(file_name, text, context = {})
Gitlab::OtherMarkup.render(file_name, text, context) Gitlab::OtherMarkup.render(file_name, text, context)
end end
......
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