Fix markdown math brackets render problem (#31420)

Close #31371, support `($ ... $)` like GitHub

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
(cherry picked from commit 90a3c20e7996e2db577a51d37f2190e2e990a22a)

Conflicts:
	modules/markup/markdown/markdown_test.go
	trivial context conflict
(cherry picked from commit b53be9d45c)
(cherry picked from commit 7fbcc58062c5cad5c4c8674915ea0fffa659b51d)
This commit is contained in:
charles 2024-06-20 10:12:54 +08:00 committed by Earl Warren
parent e61aa25412
commit 4ed5044dea
No known key found for this signature in database
GPG key ID: 0579CB2928A78A00
2 changed files with 9 additions and 1 deletions

View file

@ -549,6 +549,10 @@ func TestMathBlock(t *testing.T) {
`$$a`,
`<p>$$a</p>` + nl,
},
{
"$a$ ($b$) [$c$] {$d$}",
`<p><code class="language-math is-loading">a</code> (<code class="language-math is-loading">b</code>) [$c$] {$d$}</p>` + nl,
},
}
for _, test := range testcases {