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:
parent
51b76806b4
commit
3931b8fc83
@ -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)
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user