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

This commit is contained in:
Veronica Berglyd Olsen committed 2024-10-24 00:02:39 +02:00
1 parent f77cd1c752
commit bfa82f6bb3
5 files changed
+185 -109

No files matched your search

+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: