0
0
mirror of https://github.com/go-gitea/gitea.git synced 2025-12-12 12:49:20 +01:00

Add .org file detection to WikiRaw function

This commit is contained in:
Aly Sewelam 2025-11-24 11:52:28 +02:00
parent 51b76806b4
commit 3931b8fc83

View File

@ -669,8 +669,15 @@ func WikiRaw(ctx *context.Context) {
}
if entry == nil {
// Try to find a wiki page with that name
providedGitPath = strings.TrimSuffix(providedGitPath, ".md")
// Try to find a wiki page with that name (check both .md and .org)
providedGitPath := strings.TrimSuffix(providedGitPath, ".md")
// Try .org version
orgPath := providedGitPath + ".org"
entry, err = findEntryForFile(commit, orgPath)
if err != nil && !git.IsErrNotExist(err) {
ctx.ServerError("findFile", err)
return
}
entry, err = findEntryForFile(commit, providedGitPath)
if err != nil && !git.IsErrNotExist(err) {
ctx.ServerError("findFile", err)