Fix text rendering of readme/index
This commit is contained in:
parent
24e5599748
commit
3cd538c2e9
2 changed files with 5 additions and 1 deletions
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue