]> source.dussan.org Git - gitea.git/commitdiff
Fix the issue ref rendering for wiki (#28556) (#28559)
authorGiteabot <teabot@gitea.io>
Wed, 20 Dec 2023 14:51:25 +0000 (22:51 +0800)
committerGitHub <noreply@github.com>
Wed, 20 Dec 2023 14:51:25 +0000 (22:51 +0800)
Backport #28556 by wxiaoguang

Fix #28526, regression of
* #26365

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
modules/markup/html.go

index 774cbe1557e445b9b7da4851db0c5c4ef4f87e76..03168b69468144fe62aa21dfb810bcaf05a8536a 100644 (file)
@@ -852,7 +852,9 @@ func fullIssuePatternProcessor(ctx *RenderContext, node *html.Node) {
 }
 
 func issueIndexPatternProcessor(ctx *RenderContext, node *html.Node) {
-       if ctx.Metas == nil || ctx.Metas["mode"] == "document" {
+       // FIXME: the use of "mode" is quite dirty and hacky, for example: what is a "document"? how should it be rendered?
+       // The "mode" approach should be refactored to some other more clear&reliable way.
+       if ctx.Metas == nil || (ctx.Metas["mode"] == "document" && !ctx.IsWiki) {
                return
        }
        var (