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
path: root/lib
diff options
context:
space:
mode:
authorDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>2015-07-09 12:36:09 +0300
committerDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>2015-07-09 12:36:09 +0300
commit1bf3e1578abf41d937a2bf8e2512e0174ed0a4b4 (patch)
tree73d781b23380cac46a1d7e643e5b1e235b769474 /lib
parent3cdd68475f80c43371610c981b41cd3dc87e3300 (diff)
Properly render plain readme
Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
Diffstat (limited to 'lib')
-rw-r--r--lib/gitlab/markup_helper.rb10
1 files changed, 10 insertions, 0 deletions
diff --git a/lib/gitlab/markup_helper.rb b/lib/gitlab/markup_helper.rb
index f99be969d3e..b1991e2e285 100644
--- a/lib/gitlab/markup_helper.rb
+++ b/lib/gitlab/markup_helper.rb
@@ -33,6 +33,16 @@ module Gitlab
filename.downcase.end_with?(*%w(.adoc .ad .asciidoc))
end
+ # Public: Determines if the given filename is plain text.
+ #
+ # filename - Filename string to check
+ #
+ # Returns boolean
+ def plain?(filename)
+ filename.downcase.end_with?('.txt') ||
+ filename.downcase == 'readme'
+ end
+
def previewable?(filename)
markup?(filename)
end