feat(export/markdown): export in-line math properly

This commit is contained in:
Elian Doran
2025-04-05 09:28:18 +03:00
parent 173fa36fca
commit 894cfe4f7a
2 changed files with 24 additions and 0 deletions

View File

@@ -279,4 +279,10 @@ describe("Markdown export", () => {
expect(markdownExportService.toMarkdown(html)).toBe(expected);
});
it("converts inline math expressions to proper Markdown syntax", () => {
const html = /*html*/`<p>The equation is&nbsp;<span class="math-tex">\(e=mc^{2}\)</span>.</p>`;
const expected = `The equation is\u00a0$e=mc^{2}$.`;
expect(markdownExportService.toMarkdown(html)).toBe(expected);
});
});