Skip to content

Commit 034d126

Browse files
committed
Fix reDOS in HTML tokenizer regex
1 parent adf4e81 commit 034d126

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lib/markdown2.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1273,7 +1273,7 @@ def _run_span_gamut(self, text: str) -> str:
12731273
\s+ # whitespace after tag
12741274
(?:[^\t<>"'=/]+:)?
12751275
[^<>"'=/]+= # attr name
1276-
(?:".*?"|'.*?'|[^<>"'=/\s]+) # value, quoted or unquoted. If unquoted, no spaces allowed
1276+
(?:"[^"]*?"|'[^']*?'|[^<>"'=/\s]+) # value, quoted or unquoted. If unquoted, no spaces allowed
12771277
)*
12781278
\s*/?>
12791279
|

0 commit comments

Comments
 (0)