diff options
| author | Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com> | 2014-08-11 13:02:24 +0300 |
|---|---|---|
| committer | Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com> | 2014-08-11 13:02:24 +0300 |
| commit | 505203e7d5360500a40cc2a6894f87ad68d44dfd (patch) | |
| tree | ec3cf5737bacb3ae399372d43ba3528039b2935c /lib | |
| parent | ddd238eff87cb2df799b17dd3e8701780cc4d5b4 (diff) | |
| parent | d7701a263f71d48ba284ad325fd7c5a48742fe7d (diff) | |
| download | gitlab-ce-505203e7d5360500a40cc2a6894f87ad68d44dfd.tar.gz | |
Merge pull request #7466 from Razer6/improve_markup_handling
Improve readme markup, fixes #7455
Diffstat (limited to 'lib')
| -rw-r--r-- | lib/gitlab/markdown_helper.rb | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/lib/gitlab/markdown_helper.rb b/lib/gitlab/markdown_helper.rb new file mode 100644 index 00000000000..abed12fe570 --- /dev/null +++ b/lib/gitlab/markdown_helper.rb @@ -0,0 +1,25 @@ +module Gitlab + module MarkdownHelper + module_function + + # Public: Determines if a given filename is compatible with GitHub::Markup. + # + # filename - Filename string to check + # + # Returns boolean + def markup?(filename) + filename.downcase.end_with?(*%w(.textile .rdoc .org .creole .wiki + .mediawiki .rst .adoc .asciidoc .asc)) + end + + # Public: Determines if a given filename is compatible with + # GitLab-flavored Markdown. + # + # filename - Filename string to check + # + # Returns boolean + def gitlab_markdown?(filename) + filename.downcase.end_with?(*%w(.mdown .md .markdown)) + end + end +end |
