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)
This commit is contained in:
charles 2024-06-30 07:23:47 +08:00 committed by GitHub
parent 91745ae46f
commit f0033051d5
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
6 changed files with 79 additions and 6 deletions

View file

@ -555,6 +555,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 {