Skip to content

Commit 51b7680

Browse files
author
Aly Sewelam
committed
Detect markup type instead of defaulting to .md
This handles .org files markup detection
1 parent cb38c04 commit 51b7680

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

routers/web/repo/wiki.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -534,7 +534,9 @@ func Wiki(ctx *context.Context) {
534534
}
535535

536536
wikiPath := entry.Name()
537-
if markup.DetectMarkupTypeByFileName(wikiPath) != markdown.MarkupName {
537+
detectedMarkupType := markup.DetectMarkupTypeByFileName(wikiPath)
538+
if detectedMarkupType == "" {
539+
// Only show warning if no renderer was found for this file type
538540
ext := strings.ToUpper(filepath.Ext(wikiPath))
539541
ctx.Data["FormatWarning"] = ext + " rendering is not supported at the moment. Rendered as Markdown."
540542
}

0 commit comments

Comments
 (0)