Skip to content

Commit 2aebce5

Browse files
yp05327wxiaoguang
authored andcommitted
Fix inconsistent rendering of block mathematical expressions (go-gitea#29677)
Fix go-gitea#28735 GitHub render `\```math\``` ` as a block now. Add `display` class will render it as a block. After: ![image](https://github.com/go-gitea/gitea/assets/18380374/2a1c20c7-438e-4ab1-8c66-cf91c8343087) ![image](https://github.com/go-gitea/gitea/assets/18380374/b81b8a93-8bca-46a5-b7db-e0d2f53e1342) --------- Co-authored-by: wxiaoguang <[email protected]>
1 parent 93e105a commit 2aebce5

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

modules/markup/markdown/markdown.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,8 @@ func SpecializedMarkdown() goldmark.Markdown {
103103
}
104104

105105
// include language-x class as part of commonmark spec
106-
_, err = w.WriteString(`<code class="chroma language-` + string(language) + `">`)
106+
// the "display" class is used by "js/markup/math.js" to render the code element as a block
107+
_, err = w.WriteString(`<code class="chroma language-` + string(language) + ` display">`)
107108
if err != nil {
108109
return
109110
}

0 commit comments

Comments
 (0)