Add text marker processing in tokenizer class

This commit is contained in:
Veronica Berglyd Olsen
2024-04-15 00:42:01 +02:00
parent ec6a5712e5
commit 9823677983
5 changed files with 71 additions and 37 deletions
+3 -1
View File
@@ -171,7 +171,7 @@ class ToHtml(Tokenizer):
tHandle = self._handle
for tType, nHead, tText, tFormat, tStyle in self._tokens:
for tType, nHead, tText, tFormat, tMarkers, tStyle in self._tokens:
# Replace < and > with HTML entities
if tFormat:
@@ -280,6 +280,8 @@ class ToHtml(Tokenizer):
pStyle = hStyle
for pos, fmt in reversed(tFormat):
tTemp = f"{tTemp[:pos]}{htmlTags[fmt]}{tTemp[pos:]}"
for pos, fmt, key in reversed(tMarkers):
tTemp = f"{tTemp[:pos]}<sup>[x]</sub>{tTemp[pos:]}"
para.append(stripEscape(tTemp.rstrip()))
elif tType == self.T_SYNOPSIS and self._doSynopsis: