Fix greater/lesser symbol bug in HTML conversion (#928)
* Fix issue with greater or lesser symbol in paragraph with formatting * Add test coverage and make another fix to special case of mixing formats
This commit is contained in:
committed by
GitHub
parent
32d6583ae3
commit
67d2e266fd
@@ -146,10 +146,25 @@ class ToHtml(Tokenizer):
|
||||
parStyle = None
|
||||
tmpResult = []
|
||||
|
||||
for tType, tLine, tText, tFormat, tStyle in self.theTokens:
|
||||
for tType, tLine, tDirty, tFormat, tStyle in self.theTokens:
|
||||
|
||||
# Replace < and > before adding html tags
|
||||
tText = tText.replace("<", "<").replace(">", ">")
|
||||
# Replace < and > and recompute formatting positions
|
||||
cText = []
|
||||
i = 0
|
||||
for c in tDirty:
|
||||
if c == "<":
|
||||
cText.append("<")
|
||||
tFormat = [[a + 3 if a > i else a, b, c] for a, b, c in tFormat]
|
||||
i += 4
|
||||
elif c == ">":
|
||||
cText.append(">")
|
||||
tFormat = [[a + 3 if a > i else a, b, c] for a, b, c in tFormat]
|
||||
i += 4
|
||||
else:
|
||||
cText.append(c)
|
||||
i += 1
|
||||
|
||||
tText = "".join(cText)
|
||||
|
||||
# Styles
|
||||
aStyle = []
|
||||
|
||||
Reference in New Issue
Block a user