Drop empty tokens from the tokenizer data

This commit is contained in:
Veronica Berglyd Olsen
2024-05-21 22:45:01 +02:00
parent adf0550571
commit 7a13b14c15
5 changed files with 31 additions and 137 deletions
+3 -6
View File
@@ -142,8 +142,9 @@ class ToMarkdown(Tokenizer):
lines = []
for tType, _, tText, tFormat, tStyle in self._tokens:
if tType == self.T_EMPTY:
pass
if tType == self.T_TEXT:
tTemp = self._formatText(tText, tFormat, mTags).replace("\n", " \n")
lines.append(f"{tTemp}\n\n")
elif tType == self.T_TITLE:
tHead = tText.replace(nwHeadFmt.BR, "\n")
@@ -171,10 +172,6 @@ class ToMarkdown(Tokenizer):
elif tType == self.T_SKIP:
lines.append(f"{cSkip}\n\n")
elif tType == self.T_TEXT:
tTemp = self._formatText(tText, tFormat, mTags).replace("\n", " \n")
lines.append(f"{tTemp}\n\n")
elif tType == self.T_SYNOPSIS and self._doSynopsis:
label = self._localLookup("Synopsis")
lines.append(f"**{label}:** {self._formatText(tText, tFormat, mTags)}\n\n")