Fix highlighting of multiple dialogue sections
This commit is contained in:
@@ -457,7 +457,7 @@ class ToHtml(Tokenizer):
|
||||
else:
|
||||
html = "<sup>ERR</sup>"
|
||||
else:
|
||||
html = HTML5_TAGS.get(fmt, "ERR")
|
||||
html = HTML5_TAGS.get(fmt, "")
|
||||
temp = f"{temp[:pos]}{html}{temp[pos:]}"
|
||||
temp = temp.replace("\n", "<br>")
|
||||
return stripEscape(temp)
|
||||
|
||||
@@ -1139,7 +1139,9 @@ class Tokenizer(ABC):
|
||||
# Match Dialogue
|
||||
if self._rxDialogue:
|
||||
for regEx, fmtB, fmtE in self._rxDialogue:
|
||||
if (rxMatch := regEx.match(text, 0)).hasMatch():
|
||||
rxItt = regEx.globalMatch(text, 0)
|
||||
while rxItt.hasNext():
|
||||
rxMatch = rxItt.next()
|
||||
temp.append((rxMatch.capturedStart(0), 0, fmtB, ""))
|
||||
temp.append((rxMatch.capturedEnd(0), 0, fmtE, ""))
|
||||
|
||||
|
||||
Reference in New Issue
Block a user