Inhaltsverzeichnis einheitlich: Einträge als Absätze statt "\"-Zeilen
- Im Inhaltsverzeichnis wird jeder Eintrag ein eigener Absatz, auch wenn
er als zeilengetreu erkannt wurde (vorher gemischte Abstände im EPUB)
- Zeilen, die wie Gliederungseinträge aussehen ("Teil V: …", "32 …"),
werden auch ohne Überschrift "Inhalt" zu Absätzen (Vorschau Band Zwei)
- Tests, README
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
parent
d322ee3523
commit
f0e0562451
1 changed files with 42 additions and 2 deletions
|
|
@ -141,3 +141,23 @@ def test_literal_fence_text_is_escaped_and_markers_never_leak():
|
|||
out = p.normalize_markdown(md)
|
||||
assert out.startswith("\\```")
|
||||
assert not p.MARKERS.search(out)
|
||||
|
||||
|
||||
def test_contents_entries_are_uniform_paragraphs():
|
||||
outline = {"vorwort": 2, "1 der notar": 3, "2 ein brief": 3}
|
||||
md = (
|
||||
f"## Inhaltsverzeichnis\n\nTitel{H}\nVorwort{H}\n1 Der Notar{P}\n\n"
|
||||
f"2 Ein Brief{B}40{B}\n\n## Vorwort\n\nText.\n"
|
||||
)
|
||||
assert p.normalize_markdown(md, outline) == (
|
||||
"## Inhaltsverzeichnis\n\nTitel\n\nVorwort\n\n1 Der Notar\n\n2 Ein Brief\n\n"
|
||||
"## Vorwort\n\nText.\n"
|
||||
)
|
||||
|
||||
|
||||
def test_outline_like_lines_outside_contents_become_paragraphs():
|
||||
md = f"## Vorschau Band Zwei\n\n32 Oberst a.D.{H}\n33 Wolga-Attacke{P}\n\nTeil VI: Polen{H}\nOperation Morgenlicht{P}\n"
|
||||
assert p.normalize_markdown(md) == (
|
||||
"## Vorschau Band Zwei\n\n32 Oberst a.D.\n\n33 Wolga-Attacke\n\n"
|
||||
"Teil VI: Polen\n\nOperation Morgenlicht\n"
|
||||
)
|
||||
|
|
|
|||
Loading…
Reference in a new issue