diff options
-rw-r--r-- | modules/markup/renderer.go | 2 | ||||
-rw-r--r-- | modules/markup/renderer_test.go | 10 |
2 files changed, 12 insertions, 0 deletions
diff --git a/modules/markup/renderer.go b/modules/markup/renderer.go index 9278d4c65d..5f69dc7235 100644 --- a/modules/markup/renderer.go +++ b/modules/markup/renderer.go @@ -328,11 +328,13 @@ func IsReadmeFile(name string) bool { // the length of the provided extension list. // Note that the '.' should be provided in ext, e.g ".md" func IsReadmeFileExtension(name string, ext ...string) (int, bool) { + name = strings.ToLower(name) if len(name) < 6 || name[:6] != "readme" { return 0, false } for i, extension := range ext { + extension = strings.ToLower(extension) if name[6:] == extension { return i, true } diff --git a/modules/markup/renderer_test.go b/modules/markup/renderer_test.go index 1e0f7db194..950ee15b91 100644 --- a/modules/markup/renderer_test.go +++ b/modules/markup/renderer_test.go @@ -59,6 +59,16 @@ func TestMisc_IsReadmeFile(t *testing.T) { idx: 0, }, { + name: "README.md", + expected: true, + idx: 0, + }, + { + name: "ReAdMe.Md", + expected: true, + idx: 0, + }, + { name: "readme.txt", expected: true, idx: 1, |