diff options
author | Nick <nick.guenther@polymtl.ca> | 2023-02-13 15:01:09 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-02-13 15:01:09 -0500 |
commit | 7b5b739a2f9d9c84ec216ff629dbf0d1dd8a4322 (patch) | |
tree | 80624177b947ebdb8bc33a37bb1d9334a3acd040 /routers/web/repo/view.go | |
parent | 51383ec0841ec2562e5c4a9dadd4fef82974dd5c (diff) | |
download | gitea-7b5b739a2f9d9c84ec216ff629dbf0d1dd8a4322.tar.gz gitea-7b5b739a2f9d9c84ec216ff629dbf0d1dd8a4322.zip |
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>
Diffstat (limited to 'routers/web/repo/view.go')
-rw-r--r-- | routers/web/repo/view.go | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/routers/web/repo/view.go b/routers/web/repo/view.go index ca86c744d1..8f2213a68c 100644 --- a/routers/web/repo/view.go +++ b/routers/web/repo/view.go @@ -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()) |