diff --git a/packages/client/ui-primitives/tests/markdown.spec.tsx b/packages/client/ui-primitives/tests/markdown.spec.tsx index ea2abc2b7c..c34f8227c3 100644 --- a/packages/client/ui-primitives/tests/markdown.spec.tsx +++ b/packages/client/ui-primitives/tests/markdown.spec.tsx @@ -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() + + 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', () => { const data: { micromarkExtensions?: Extension[] } = {} remarkMathCompatibility.call({ data: () => data })