feat: count references during parsing for pictures

This commit is contained in:
Tim Grelka
2026-01-11 02:39:21 +01:00
parent 99e97ee3c6
commit b6a8b6686b
5 changed files with 77 additions and 27 deletions
+5 -6
View File
@@ -1,19 +1,18 @@
import mistletoe
import pytest
from renderer.document import Document
from renderer.fifty_ohm_html_renderer import FiftyOhmHtmlRenderer
from renderer.fifty_ohm_latex_renderer import FiftyOhmLaTeXRenderer
from test.util import paragraph
@pytest.mark.html
def test_picture_html():
assertions = {
"[picture:0:abc:Text]": FiftyOhmHtmlRenderer.render_picture_helper("0", "abc", "Text", "TODO", ""),
}
assertions = {"[picture:0:abc:Text]": ("0", "abc", "Text", "A-5.7.1", "")}
for assertion in assertions:
assert mistletoe.markdown(assertion, FiftyOhmHtmlRenderer) == paragraph(assertions[assertion])
with FiftyOhmHtmlRenderer(edition="A", chapter="5", section="7") as renderer:
for assertion in assertions:
assert renderer.render(Document(assertion)) == renderer.render_picture_helper(*assertions[assertion]) + "\n"
@pytest.mark.latex