Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJakub Jirutka <jakub@jirutka.cz>2015-05-13 02:54:13 +0300
committerJakub Jirutka <jakub@jirutka.cz>2015-05-18 23:52:13 +0300
commitb0659c1b072267e0e1fa3066ca1a8cc17bc8f6c0 (patch)
tree54701d5d517061602ff5ac58512268f4c18a105a /app/helpers
parentdaa0925016a63dcde448643cbf1310aca359cf37 (diff)
Simplify and unify helpers for rendering markup
Diffstat (limited to 'app/helpers')
-rw-r--r--app/helpers/application_helper.rb4
-rw-r--r--app/helpers/tree_helper.rb10
2 files changed, 4 insertions, 10 deletions
diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb
index 5bcc0026016..bcd400b7e7b 100644
--- a/app/helpers/application_helper.rb
+++ b/app/helpers/application_helper.rb
@@ -222,7 +222,9 @@ module ApplicationHelper
end
def render_markup(file_name, file_content)
- if asciidoc?(file_name)
+ if gitlab_markdown?(file_name)
+ Haml::Helpers.preserve(markdown(file_content))
+ elsif asciidoc?(file_name)
asciidoc(file_content)
else
GitHub::Markup.render(file_name, file_content).
diff --git a/app/helpers/tree_helper.rb b/app/helpers/tree_helper.rb
index c03564a71ab..03a49e119b8 100644
--- a/app/helpers/tree_helper.rb
+++ b/app/helpers/tree_helper.rb
@@ -25,15 +25,7 @@ module TreeHelper
end
def render_readme(readme)
- if gitlab_markdown?(readme.name)
- preserve(markdown(readme.data))
- elsif asciidoc?(readme.name)
- asciidoc(readme.data)
- elsif markup?(readme.name)
- render_markup(readme.name, readme.data)
- else
- simple_format(readme.data)
- end
+ render_markup(readme.name, readme.data)
end
# Return an image icon depending on the file type and mode