From 21bcfb1d007efc36d0548231e6984df3ce15d7b4 Mon Sep 17 00:00:00 2001 From: Nulo Date: Tue, 31 May 2022 18:10:59 -0300 Subject: [PATCH] Allow hidden .READMEs --- modules/markup/renderer.go | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/modules/markup/renderer.go b/modules/markup/renderer.go index 0ac0daaea..202959e61 100644 --- a/modules/markup/renderer.go +++ b/modules/markup/renderer.go @@ -225,13 +225,5 @@ func IsMarkupFile(name, markup string) bool { // Note that the '.' should be provided in ext, e.g ".md" func IsReadmeFile(name string, ext ...string) bool { name = strings.ToLower(name) - if len(ext) > 0 { - return name == "readme"+ext[0] - } - if len(name) < 6 { - return false - } else if len(name) == 6 { - return name == "readme" - } - return name[:7] == "readme." + return name == "readme" || strings.Index(name, "readme.") == 0 || strings.Index(name, ".readme.") == 0 }