Skip to content
This repository was archived by the owner on Jun 24, 2025. It is now read-only.

Commit 58e53fc

Browse files
committed
add test case for multiple inline math expressions in imported Markdown
1 parent 8355e02 commit 58e53fc

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

apps/server/src/services/import/markdown.spec.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -188,6 +188,12 @@ second line 2</code></pre><ul><li>Hello</li><li>world</li></ul><ol><li>Hello</li
188188
expect(markdownService.renderToHtml(input, "Title")).toStrictEqual(expected);
189189
});
190190

191+
it("converts multiple inline math expressions into Mathtex format", () => {
192+
const input = `Energy: $e=mc^{2}$, Force: $F=ma$.`;
193+
const expected = /*html*/`<p>Energy: <span class="math-tex">\\(e=mc^{2}\\)</span>, Force: <span class="math-tex">\\(F=ma\\)</span>.</p>`;
194+
expect(markdownService.renderToHtml(input, "Title")).toStrictEqual(expected);
195+
});
196+
191197
it("converts display math expressions into Mathtex format", () => {
192198
const input = `$$\sqrt{x^{2}+1}$$`;
193199
const expected = /*html*/`<p><span class="math-tex">\\[\sqrt{x^{2}+1}\\]</span></p>`;

0 commit comments

Comments
 (0)