0
0
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:
Aly Sewelam 2025-11-24 11:35:27 +02:00
parent cb38c046b2
commit 51b76806b4

View File

@ -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."
}