diff options
author | Jakub Jirutka <jakub@jirutka.cz> | 2015-05-13 02:54:13 +0300 |
---|---|---|
committer | Jakub Jirutka <jakub@jirutka.cz> | 2015-05-18 23:52:13 +0300 |
commit | b0659c1b072267e0e1fa3066ca1a8cc17bc8f6c0 (patch) | |
tree | 54701d5d517061602ff5ac58512268f4c18a105a /lib/gitlab | |
parent | daa0925016a63dcde448643cbf1310aca359cf37 (diff) |
Simplify and unify helpers for rendering markup
Diffstat (limited to 'lib/gitlab')
-rw-r--r-- | lib/gitlab/markup_helper.rb | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/lib/gitlab/markup_helper.rb b/lib/gitlab/markup_helper.rb index fb037266d23..f99be969d3e 100644 --- a/lib/gitlab/markup_helper.rb +++ b/lib/gitlab/markup_helper.rb @@ -8,8 +8,10 @@ module Gitlab # # Returns boolean def markup?(filename) - filename.downcase.end_with?(*%w(.textile .rdoc .org .creole .wiki - .mediawiki .rst .adoc .ad .asciidoc)) + gitlab_markdown?(filename) || + asciidoc?(filename) || + filename.downcase.end_with?(*%w(.textile .rdoc .org .creole .wiki + .mediawiki .rst)) end # Public: Determines if a given filename is compatible with @@ -32,7 +34,7 @@ module Gitlab end def previewable?(filename) - gitlab_markdown?(filename) || markup?(filename) + markup?(filename) end end end |