mirror of
https://github.com/zadam/trilium.git
synced 2025-11-18 11:10:41 +01:00
feat(export/markdown): export display math properly
This commit is contained in:
@@ -279,10 +279,16 @@ describe("Markdown export", () => {
|
||||
expect(markdownExportService.toMarkdown(html)).toBe(expected);
|
||||
});
|
||||
|
||||
it("converts inline math expressions to proper Markdown syntax", () => {
|
||||
it("converts inline math expressions into proper Markdown syntax", () => {
|
||||
const html = /*html*/`<p>The equation is <span class="math-tex">\(e=mc^{2}\)</span>.</p>`;
|
||||
const expected = `The equation is\u00a0$e=mc^{2}$.`;
|
||||
expect(markdownExportService.toMarkdown(html)).toBe(expected);
|
||||
});
|
||||
|
||||
it("converts display math expressions into proper Markdown syntax", () => {
|
||||
const html = /*html*/`<span class="math-tex">\[\sqrt{x^{2}+1}\]</span>`;
|
||||
const expected = `$$\sqrt{x^{2}+1}$$`;
|
||||
expect(markdownExportService.toMarkdown(html)).toBe(expected);
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user