fix: Befunde aus der QA-Prüfung (Prompt_Kontrolle.md)

- F1: Nicht beschreibbares Ausgabeziel liefert eine verständliche
  Meldung und Exit 1 statt "Interner Fehler" (Exit 4).
- F2: Anker von <dt id> stehen vor dem fett gesetzten Glossarbegriff
  statt innerhalb der **-Marker.
- F3: Formeln als <img src="*.svg"> erscheinen im Bericht mit
  origin "svg" statt "image".

Regressionstests für alle drei Befunde ergänzt.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Dieter Schlüter 2026-10-05 19:47:45 +02:00
commit 3b07fcf01a

View file

@ -114,3 +114,11 @@ def test_layout_table_headings_are_recognized(convert):
assert "# 3 Grundlagen" in text
assert "## 3.1 Einführung" in text
assert "<table" not in text
def test_glossary_anchor_is_placed_before_bold_term(convert):
"""QA-F2: the anchor of a <dt id> must not end up inside the bold markers."""
body = ('<h1>K</h1><p><a href="#g">API</a></p><section epub:type="glossary"><h2>Glossar</h2>'
'<dl><dt id="g">API</dt><dd>Schnittstelle.</dd></dl></section>')
text = convert(Book(docs=[Doc("c.xhtml", body)])).chapter("002")
assert '<a id="g"></a>**API:** Schnittstelle.' in text