Use format list also for marker keys

This commit is contained in:
Veronica Berglyd Olsen
2024-04-15 01:11:32 +02:00
parent 9823677983
commit 7c4d4dec5c
4 changed files with 56 additions and 51 deletions
+2 -2
View File
@@ -135,7 +135,7 @@ class ToMarkdown(Tokenizer):
lines = []
lineSep = " \n" if self._preserveBreaks else " "
for tType, _, tText, tFormat, tMarkers, tStyle in self._tokens:
for tType, _, tText, tFormat, tStyle in self._tokens:
if tType == self.T_EMPTY:
if para:
@@ -171,7 +171,7 @@ class ToMarkdown(Tokenizer):
elif tType == self.T_TEXT:
tTemp = tText
for pos, fmt in reversed(tFormat):
for pos, fmt, _ in reversed(tFormat):
tTemp = f"{tTemp[:pos]}{mdTags[fmt]}{tTemp[pos:]}"
para.append(tTemp.rstrip())