Commit 3cd538c2 authored by James Lopez's avatar James Lopez

Fix text rendering of readme/index

parent 24e55997
......@@ -8,7 +8,7 @@ module Gitlab
module FileDetector
PATTERNS = {
# Project files
readme: %r{\A(readme|index)[^/]*\z}i,
readme: %r{\A(readme|index)(|\.#{Gitlab::MarkupHelper::EXTENSIONS.join('|\.')})$[^\/]*\z}i,
changelog: %r{\A(changelog|history|changes|news)[^/]*\z}i,
license: %r{\A((un)?licen[sc]e|copying)(\.[^/]+)?\z}i,
contributing: %r{\Acontributing[^/]*\z}i,
......
......@@ -23,6 +23,10 @@ describe Gitlab::FileDetector do
end
end
it 'returns nil for a README.rb file' do
expect(described_class.type_of('README.rb')).to be_nil
end
it 'returns nil for a README file in a directory' do
expect(described_class.type_of('foo/README.md')).to be_nil
end
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment