mirror of
https://github.com/go-gitea/gitea.git
synced 2025-12-13 06:09:50 +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 {
|
if entry == nil {
|
||||||
// Try to find a wiki page with that name
|
// Try to find a wiki page with that name (check both .md and .org)
|
||||||
providedGitPath = strings.TrimSuffix(providedGitPath, ".md")
|
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)
|
entry, err = findEntryForFile(commit, providedGitPath)
|
||||||
if err != nil && !git.IsErrNotExist(err) {
|
if err != nil && !git.IsErrNotExist(err) {
|
||||||
ctx.ServerError("findFile", err)
|
ctx.ServerError("findFile", err)
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user