feature: ability to detect includes

This commit is contained in:
Prof. Dr. Matthias Jung DL9MJ
2025-06-24 22:04:14 +02:00
committed by Tim Grelka
parent 5d0084bac5
commit 2d0dc3e1fc
3 changed files with 44 additions and 1 deletions
+18
View File
@@ -0,0 +1,18 @@
import pytest
from mistletoe import Document
from renderer.fifty_ohm_html_renderer import FiftyOhmHtmlRenderer
@pytest.mark.html
def test_include_html():
assertions = {
'[include:ident]': "<p>ident</p>\n",
}
def test_function(input):
return f"{input}"
with FiftyOhmHtmlRenderer(include_handler=test_function) as renderer:
for assertion in assertions:
assert renderer.render(Document(assertion)) == assertions[assertion]