test(ui): keep TeX delimiters out of code fences
This commit is contained in:
@@ -251,6 +251,15 @@ describe('MarkdownText', () => {
|
|||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
|
it('leaves TeX-looking fenced code literal', () => {
|
||||||
|
const source = '```tex\n\\[\\frac{1}{5}\\]\n$$x \\tag{1}$$\n```'
|
||||||
|
const { container } = render(<MarkdownText text={source} />)
|
||||||
|
|
||||||
|
expect(container.querySelector('.katex')).toBeNull()
|
||||||
|
expect(container.querySelector('pre code')?.textContent).toContain('\\[\\frac{1}{5}\\]')
|
||||||
|
expect(container.querySelector('pre code')?.textContent).toContain('$$x \\tag{1}$$')
|
||||||
|
})
|
||||||
|
|
||||||
it('registers the compatibility extension on a bare remark processor', () => {
|
it('registers the compatibility extension on a bare remark processor', () => {
|
||||||
const data: { micromarkExtensions?: Extension[] } = {}
|
const data: { micromarkExtensions?: Extension[] } = {}
|
||||||
remarkMathCompatibility.call({ data: () => data })
|
remarkMathCompatibility.call({ data: () => data })
|
||||||
|
|||||||
Reference in New Issue
Block a user