Add .org file detection to WikiRaw function

This commit is contained in:
Aly Sewelam
2025-11-24 12:31:37 +02:00
parent 51b76806b4
commit 3931b8fc83
+9 -2
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)