fix: Inline-SVG in HTML-Tabellen als <img> ausgeben (QA2-05)

Eingebettete SVGs in komplexen Tabellen wurden als Markdown-Bild
![…](…) in den HTML-Block geschrieben und daher nicht angezeigt.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Dieter Schlüter 2026-10-06 00:00:58 +02:00
commit e9120c84ef

View file

@ -86,3 +86,15 @@ def test_end_of_book_reference_inside_html_table_is_html(convert):
table = _html_table(run.chapter("001"))
assert "](" not in table, table
assert '<a href="999-anmerkungen.md#fn-001">1</a>' in table
def test_inline_svg_inside_html_table_is_html_img(convert):
"""QA2-05: inline SVG in a complex table was written as Markdown image inside the HTML block."""
body = ('<h1>T</h1><table><tr><th colspan="2">Kopf</th></tr><tr><td>A</td><td>'
'<svg xmlns="http://www.w3.org/2000/svg" width="5" height="5" aria-label="Kreis"><circle r="2"/></svg>'
"</td></tr></table>")
run = convert(Book(docs=[Doc("c.xhtml", body)]))
table = _html_table(run.chapter("001"))
assert "![" not in table, table
assert re.search(r'<img src="\.\./media/images/\d{4}-c-svg\.svg" alt="Kreis"/>', table), table
assert run.report["output_link_check"]["broken_count"] == 0