Merge pull request #2764 from InspectorCaracal/fix-text2html-normal

Fix ANSI_NORMAL override in text2html
This commit is contained in:
Griatch 2022-06-12 00:48:28 +02:00 committed by GitHub
commit b1d611c6ca

View file

@ -234,9 +234,9 @@ class TextToHTMLparser(object):
for i, substr in enumerate(str_list):
# reset all current styling
if substr == ANSI_NORMAL and not clean:
# replace with close existing tag
str_list[i] = "</span>"
if substr == ANSI_NORMAL:
# close any existing span if necessary
str_list[i] = "</span>" if not clean else ""
# reset to defaults
classes = []
clean = True