diff --git a/appview/pages/markup/format.go b/appview/pages/markup/format.go --- a/appview/pages/markup/format.go +++ b/appview/pages/markup/format.go @@ -17,7 +17,7 @@ var FileTypePatterns = map[Format]*regexp.Regexp{ FormatMarkdown: regexp.MustCompile(`(?i)\.(md|markdown|mdown|mkdn|mkd)$`), } -var ReadmePattern = regexp.MustCompile(`(?i)^readme(?:[._-].+)?$`) +var ReadmePattern = regexp.MustCompile(`(?i)^readme(?:\.[^.]+)?$`) // IsReadmeFile reports whether name/mode identifies a readme blob. The git // mode is checked so directories or symlinks named "readme" are filtered out. diff --git a/appview/pages/markup/format_test.go b/appview/pages/markup/format_test.go --- a/appview/pages/markup/format_test.go +++ b/appview/pages/markup/format_test.go @@ -30,13 +30,16 @@ // as the README blob; tree handlers used to fetch it and 503. {"readme", dirMode, false}, {"README.md", dirMode, false}, - // readme is matched by convention, not by renderable format — + // readme is matched by convention, not by renderable format; // unsupported markup falls through to plaintext in GetFormat. {"README.rst", fileMode, true}, {"README.org", fileMode, true}, - {"readme-old", fileMode, true}, - {"readme_legacy", fileMode, true}, + {"README.asciidoc", fileMode, true}, + {"README.foo", fileMode, true}, + {"README.Music.md", fileMode, false}, + {"readme-old", fileMode, false}, + {"readme_legacy", fileMode, false}, {"notreadme.md", fileMode, false}, {"READMEISH", fileMode, false}, {"README.md", "", false},