mirror of
https://github.com/go-gitea/gitea
synced 2025-07-09 20:17:21 +00:00
@ -12,8 +12,9 @@ import (
|
||||
"github.com/stretchr/testify/assert"
|
||||
)
|
||||
|
||||
const nl = "\n"
|
||||
|
||||
func TestMathRender(t *testing.T) {
|
||||
const nl = "\n"
|
||||
testcases := []struct {
|
||||
testcase string
|
||||
expected string
|
||||
@ -86,6 +87,18 @@ func TestMathRender(t *testing.T) {
|
||||
`$\text{$b$}$`,
|
||||
`<p><code class="language-math">\text{$b$}</code></p>` + nl,
|
||||
},
|
||||
{
|
||||
"a$`b`$c",
|
||||
`<p>a<code class="language-math">b</code>c</p>` + nl,
|
||||
},
|
||||
{
|
||||
"a $`b`$ c",
|
||||
`<p>a <code class="language-math">b</code> c</p>` + nl,
|
||||
},
|
||||
{
|
||||
"a$``b``$c x$```y```$z",
|
||||
`<p>a<code class="language-math">b</code>c x<code class="language-math">y</code>z</p>` + nl,
|
||||
},
|
||||
}
|
||||
|
||||
for _, test := range testcases {
|
||||
@ -215,6 +228,11 @@ x
|
||||
</ol>
|
||||
`,
|
||||
},
|
||||
{
|
||||
"inline-non-math",
|
||||
`\[x]`,
|
||||
`<p>[x]</p>` + nl,
|
||||
},
|
||||
}
|
||||
|
||||
for _, test := range testcases {
|
||||
|
Reference in New Issue
Block a user