test(desktop): pin backslash math and the CJK-variable tradeoff
A span whose body is a backslash command is real math, and a CJK variable inside one equation must still escape while the next span stays. Co-authored-by: Yun. <fangyun1008@gmail.com>
This commit is contained in:
@@ -578,6 +578,12 @@ describe('preprocessMarkdown', () => {
|
||||
expect(preprocessMarkdown('$E = mc^2$ 代入 $x$ 求解')).toBe('$E = mc^2$ 代入 $x$ 求解')
|
||||
expect(preprocessMarkdown('$a$ 与 $b$ 之间的说明')).toBe('$a$ 与 $b$ 之间的说明')
|
||||
expect(preprocessMarkdown('$a$ 甲 $b$ 乙 $c$ 丙')).toBe('$a$ 甲 $b$ 乙 $c$ 丙')
|
||||
// Backslash commands are real math too; the closer must not be re-opened.
|
||||
expect(preprocessMarkdown('根据 $\\alpha$ 和 $\\beta$ 计算')).toBe('根据 $\\alpha$ 和 $\\beta$ 计算')
|
||||
})
|
||||
|
||||
it('still escapes a CJK variable inside one equation and keeps the next span (#103546)', () => {
|
||||
expect(preprocessMarkdown('$x = 变量$ 与 $y$')).toBe('\\$x = 变量\\$ 与 $y$')
|
||||
})
|
||||
|
||||
it('leaves real inline math adjacent to CJK untouched (#103546)', () => {
|
||||
|
||||
Reference in New Issue
Block a user