|
|
|
|
@ -163,4 +163,16 @@ second line 2</code></pre><ul><li>Hello</li><li>world</li></ul><ol><li>Hello</li
|
|
|
|
|
expect(markdownService.renderToHtml(input, "Title")).toStrictEqual(expected);
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
it("converts inline math expressions into Mathtex format", () => {
|
|
|
|
|
const input = `The equation is\u00a0$e=mc^{2}$.`;
|
|
|
|
|
const expected = /*html*/`<p>The equation is <span class="math-tex">\(e=mc^{2}\)</span>.</p>`;
|
|
|
|
|
expect(markdownService.renderToHtml(input, "Title")).toStrictEqual(expected);
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
it("converts display math expressions into Mathtex format", () => {
|
|
|
|
|
const input = `$$\sqrt{x^{2}+1}$$`;
|
|
|
|
|
const expected = /*html*/`<p><span class="math-tex">\\[\sqrt{x^{2}+1}\\]</span></p>`;
|
|
|
|
|
expect(markdownService.renderToHtml(input, "Title")).toStrictEqual(expected);
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|