Fix markdown preview $$ support (#31514)

close #31481

currently `$$A + B$$ test` will ignore text after $$ block

test text

![圖片](39b2974b-c0b6-48a0-87d0-5f4a13615eed)

before fix

![圖片](15469e4c-474d-4128-b46f-d6cadaafbd68)

after fix

![圖片](c1025eef-177f-4ade-988f-510e7039f3f9)

github display

![圖片](97cd1e10-ac94-4899-86d8-8e359ef1d694)

(cherry picked from commit f0033051d5ce07f5a18d2aacef6bfdca5fc69014)
This commit is contained in:
charles 2024-06-30 07:23:47 +08:00 committed by Earl Warren
parent e1b90212e4
commit f92591b825
No known key found for this signature in database
GPG key ID: 0579CB2928A78A00
6 changed files with 79 additions and 6 deletions

View file

@ -552,6 +552,14 @@ func TestMathBlock(t *testing.T) {
"$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,
},
{
"$$a$$ test",
`<p><code class="language-math display is-loading">a</code> test</p>` + nl,
},
{
"test $$a$$",
`<p>test <code class="language-math display is-loading">a</code></p>` + nl,
},
}
for _, test := range testcases {