Skip to content

Commit e20dd02

Browse files
committed
fix backtracking vulnerability in block.pedantic.html as in markedjs#1083
1 parent 7a9eeaa commit e20dd02

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lib/marked.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ block.pedantic = merge({}, block.normal, {
119119
html: edit(
120120
'^ *(?:comment *(?:\\n|\\s*$)'
121121
+ '|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)' // closed tag
122-
+ '|<tag(?:"[^"]*"|\'[^\']*\'|\\s[^\'"/>]*)*?/?> *(?:\\n{2,}|\\s*$))')
122+
+ '|<tag(?:"[^"]*"|\'[^\']*\'|\\s[^\'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))')
123123
.replace('comment', block._comment)
124124
.replace(/tag/g, '(?!(?:'
125125
+ 'a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub'

0 commit comments

Comments
 (0)