Add test coverage of title line breaks, and don't break markdown titles

This commit is contained in:
Veronica Berglyd Olsen
2024-10-23 21:12:25 +02:00
parent f77cd1c752
commit bfa82f6bb3
5 changed files with 185 additions and 109 deletions
+5 -5
View File
@@ -113,23 +113,23 @@ class ToMarkdown(Tokenizer):
lines.append(f"{tTemp}\n\n")
elif tType == BlockTyp.TITLE:
tHead = tText.replace(nwHeadFmt.BR, "\n")
tHead = tText.replace(nwHeadFmt.BR, " - ")
lines.append(f"# {tHead}\n\n")
elif tType == BlockTyp.HEAD1:
tHead = tText.replace(nwHeadFmt.BR, "\n")
tHead = tText.replace(nwHeadFmt.BR, " - ")
lines.append(f"# {tHead}\n\n")
elif tType == BlockTyp.HEAD2:
tHead = tText.replace(nwHeadFmt.BR, "\n")
tHead = tText.replace(nwHeadFmt.BR, " - ")
lines.append(f"## {tHead}\n\n")
elif tType == BlockTyp.HEAD3:
tHead = tText.replace(nwHeadFmt.BR, "\n")
tHead = tText.replace(nwHeadFmt.BR, " - ")
lines.append(f"### {tHead}\n\n")
elif tType == BlockTyp.HEAD4:
tHead = tText.replace(nwHeadFmt.BR, "\n")
tHead = tText.replace(nwHeadFmt.BR, " - ")
lines.append(f"#### {tHead}\n\n")
elif tType == BlockTyp.SEP: