mirror of
https://github.com/go-gitea/gitea.git
synced 2026-02-02 09:25:11 +01:00
Detect markup type instead of defaulting to .md
This handles .org files markup detection
This commit is contained in:
parent
cb38c046b2
commit
51b76806b4
@ -534,7 +534,9 @@ func Wiki(ctx *context.Context) {
|
||||
}
|
||||
|
||||
wikiPath := entry.Name()
|
||||
if markup.DetectMarkupTypeByFileName(wikiPath) != markdown.MarkupName {
|
||||
detectedMarkupType := markup.DetectMarkupTypeByFileName(wikiPath)
|
||||
if detectedMarkupType == "" {
|
||||
// Only show warning if no renderer was found for this file type
|
||||
ext := strings.ToUpper(filepath.Ext(wikiPath))
|
||||
ctx.Data["FormatWarning"] = ext + " rendering is not supported at the moment. Rendered as Markdown."
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user