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:
authorStan Hu <stanhu@gmail.com>2015-08-13 02:18:05 +0300
committerStan Hu <stanhu@gmail.com>2015-08-13 02:18:05 +0300
commite956d116c5a5147f75ff2cfc8d061ed8d628c309 (patch)
tree5e1c1ca0aaca8fc62724506b46a283224caa43f6
parent6a82c9f01868b419975409a6819aa88dd973240d (diff)
parent013260e057068ecc1e5330156d95bb7fbe996575 (diff)
Merge branch 'more-markdown-extensions' into 'master'
markup_helper: detect .mkd and .mkdn as markdown See merge request !1148
-rw-r--r--CHANGELOG1
-rw-r--r--lib/gitlab/markup_helper.rb2
-rw-r--r--spec/lib/gitlab/markup_helper_spec.rb2
3 files changed, 3 insertions, 2 deletions
diff --git a/CHANGELOG b/CHANGELOG
index f09d66ed3f7..428355a052c 100644
--- a/CHANGELOG
+++ b/CHANGELOG
@@ -53,6 +53,7 @@ v 7.14.0 (unreleased)
- Include branch/tag name in archive file and directory name
- Add dropzone upload progress
- Add a label for merged branches on branches page (Florent Baldino)
+ - Detect .mkd and .mkdn files as markdown (Ben Boeckel)
v 7.13.3
- Fix bug causing Bitbucket importer to crash when OAuth application had been removed.
diff --git a/lib/gitlab/markup_helper.rb b/lib/gitlab/markup_helper.rb
index b1991e2e285..a5f767b134d 100644
--- a/lib/gitlab/markup_helper.rb
+++ b/lib/gitlab/markup_helper.rb
@@ -21,7 +21,7 @@ module Gitlab
#
# Returns boolean
def gitlab_markdown?(filename)
- filename.downcase.end_with?(*%w(.mdown .md .markdown))
+ filename.downcase.end_with?(*%w(.mdown .mkd .mkdn .md .markdown))
end
# Public: Determines if the given filename has AsciiDoc extension.
diff --git a/spec/lib/gitlab/markup_helper_spec.rb b/spec/lib/gitlab/markup_helper_spec.rb
index 7e716e866b1..e610fab05da 100644
--- a/spec/lib/gitlab/markup_helper_spec.rb
+++ b/spec/lib/gitlab/markup_helper_spec.rb
@@ -15,7 +15,7 @@ describe Gitlab::MarkupHelper do
end
describe '#gitlab_markdown?' do
- %w(mdown md markdown).each do |type|
+ %w(mdown mkd mkdn md markdown).each do |type|
it "returns true for #{type} files" do
expect(Gitlab::MarkupHelper.gitlab_markdown?("README.#{type}")).to be_truthy
end