Use alternative level 1 format for titles and partitions for markdown

This commit is contained in:
Veronica Berglyd Olsen
2025-01-25 20:51:24 +01:00
parent 6d4e066810
commit 11d0e4220f
8 changed files with 70 additions and 35 deletions
+6 -1
View File
@@ -113,7 +113,12 @@ class ToMarkdown(Tokenizer):
tTemp = self._formatText(tText, tFormat, mTags).replace("\n", " \n")
lines.append(f"{tTemp}\n\n")
elif tType in (BlockTyp.TITLE, BlockTyp.PART, BlockTyp.HEAD1):
elif tType in (BlockTyp.TITLE, BlockTyp.PART):
tHead = tText.replace("\n", " - ")
lines.append(f"{tHead}\n")
lines.append("="*len(tHead) + "\n\n")
elif tType == BlockTyp.HEAD1:
tHead = tText.replace("\n", " - ")
lines.append(f"# {tHead}\n\n")