mirror of
https://github.com/go-gitea/gitea
synced 2025-07-22 18:28:37 +00:00
Move IsReadmeFile*
from modules/markup/
to modules/util
(#22877)
These functions don't examine contents, just filenames, so they don't fit in well in a markup module. This was originally part of https://github.com/go-gitea/gitea/pull/22177. Signed-off-by: Nick Guenther <nick.guenther@polymtl.ca>
This commit is contained in:
@@ -96,7 +96,7 @@ func findReadmeFileInEntries(ctx *context.Context, entries []*git.TreeEntry) (*n
|
||||
}
|
||||
continue
|
||||
}
|
||||
if i, ok := markup.IsReadmeFileExtension(entry.Name(), exts...); ok {
|
||||
if i, ok := util.IsReadmeFileExtension(entry.Name(), exts...); ok {
|
||||
log.Debug("Potential readme file: %s", entry.Name())
|
||||
if readmeFiles[i] == nil || base.NaturalSortLess(readmeFiles[i].name, entry.Blob().Name()) {
|
||||
name := entry.Name()
|
||||
@@ -423,7 +423,7 @@ func renderFile(ctx *context.Context, entry *git.TreeEntry, treeLink, rawLink st
|
||||
rd := charset.ToUTF8WithFallbackReader(io.MultiReader(bytes.NewReader(buf), dataRc))
|
||||
|
||||
shouldRenderSource := ctx.FormString("display") == "source"
|
||||
readmeExist := markup.IsReadmeFile(blob.Name())
|
||||
readmeExist := util.IsReadmeFileName(blob.Name())
|
||||
ctx.Data["ReadmeExist"] = readmeExist
|
||||
|
||||
markupType := markup.Type(blob.Name())
|
||||
|
Reference in New Issue
Block a user