Use stdlib re for Markdown matching

This commit is contained in:
Veronica Berglyd Olsen
2024-09-22 16:56:21 +02:00
parent d3799bc30a
commit c3cb12e5e2
4 changed files with 26 additions and 24 deletions
+2 -4
View File
@@ -1109,11 +1109,9 @@ class Tokenizer(ABC):
# Match Markdown
for regEx, fmts in self._rxMarkdown:
rxItt = regEx.globalMatch(text, 0)
while rxItt.hasNext():
rxMatch = rxItt.next()
for match in re.finditer(regEx, text):
temp.extend(
(rxMatch.capturedStart(n), rxMatch.capturedLength(n), fmt, "")
(match.start(n), len(match.group(n)), fmt, "")
for n, fmt in enumerate(fmts) if fmt > 0
)