mirror of
https://github.com/showdownjs/showdown.git
synced 2024-03-22 13:30:55 +08:00
fix(comments): Fix html comment parser
When an html comment was followed by a a long line of dashes, it would freeze the parser as the lookahead in the html comment parser regex was very slow. The regex was modified and simplified, so no lookahead is needed anymore. Closes #276
This commit is contained in:
parent
9b5a2330f6
commit
238726ca91
BIN
dist/showdown.js
vendored
BIN
dist/showdown.js
vendored
Binary file not shown.
BIN
dist/showdown.js.map
vendored
BIN
dist/showdown.js.map
vendored
Binary file not shown.
BIN
dist/showdown.min.js
vendored
BIN
dist/showdown.min.js
vendored
Binary file not shown.
BIN
dist/showdown.min.js.map
vendored
BIN
dist/showdown.min.js.map
vendored
Binary file not shown.
|
@ -56,7 +56,7 @@ showdown.subParser('hashHTMLBlocks', function (text, options, globals) {
|
|||
showdown.subParser('hashElement')(text, options, globals));
|
||||
|
||||
// Special case for standalone HTML comments:
|
||||
text = text.replace(/(<!(--[^\r]*?--\s*)+>[ \t]*(?=\n{2,}))/g,
|
||||
text = text.replace(/(<!--[\s\S]*?-->)/g,
|
||||
showdown.subParser('hashElement')(text, options, globals));
|
||||
|
||||
// PHP and ASP-style processor instructions (<?...?> and <%...%>)
|
||||
|
|
Loading…
Reference in New Issue
Block a user