diff --git a/packages/ui/markdown/Markdown.tsx b/packages/ui/markdown/Markdown.tsx index b831a45bd..b4cc96657 100644 --- a/packages/ui/markdown/Markdown.tsx +++ b/packages/ui/markdown/Markdown.tsx @@ -445,7 +445,11 @@ export function Markdown({ return (
{ + it("Markdown renders $ amounts as plain text, not inline math", () => { + const { container } = render({FINANCE_TEXT}); + expect(container.querySelector(".katex")).toBeNull(); + expect(container.textContent).toContain( + "$120/mo gross (~$85 net of fees)", + ); + }); + + it("ReadonlyContent renders $ amounts as plain text, not inline math", () => { + const { container } = render(); + expect(container.querySelector(".katex")).toBeNull(); + expect(container.textContent).toContain( + "$120/mo gross (~$85 net of fees)", + ); + }); + + it("still renders explicit $$ display math", () => { + const { container } = render({"$$\nE = mc^2\n$$"}); + expect(container.querySelector(".katex")).not.toBeNull(); + }); +}); diff --git a/packages/views/editor/readonly-content.test.tsx b/packages/views/editor/readonly-content.test.tsx index c2ca32b48..5cc649d5e 100644 --- a/packages/views/editor/readonly-content.test.tsx +++ b/packages/views/editor/readonly-content.test.tsx @@ -92,7 +92,7 @@ describe("ReadonlyContent math rendering", () => { const { container } = render(