feature: add proper formula display in text and slides

This commit is contained in:
Matthias Jung
2026-01-06 22:58:53 +04:00
parent afe33c3a17
commit 75af765790
3 changed files with 51 additions and 0 deletions
+19
View File
@@ -0,0 +1,19 @@
import pytest
from mistletoe import Document
from renderer.fifty_ohm_html_renderer import FiftyOhmHtmlRenderer
@pytest.mark.html
def test_formula_html():
assertions = {
r"$a \cdot b$": "\n" + r"$$a \cdot b$$" + "\n\n",
r" $a \cdot b$ ": "\n" + r"$$a \cdot b$$" + "\n\n",
r"$ a \cdot b $": "\n" + r"$$ a \cdot b $$" + "\n\n",
r"$a \cdot b$" + "\n" + r"$a \cdot b$": "\n" + r"$$a \cdot b$$" + "\n\n\n" + r"$$a \cdot b$$" + "\n\n",
r"Lorem Ipsum" + "\n" + r"$a \cdot b$": "<p>Lorem Ipsum</p>\n\n" + r"$$a \cdot b$$" + "\n\n",
}
with FiftyOhmHtmlRenderer() as renderer:
for assertion in assertions:
assert renderer.render(Document(assertion)) == assertions[assertion]