File tree Expand file tree Collapse file tree 1 file changed +3
-2
lines changed Expand file tree Collapse file tree 1 file changed +3
-2
lines changed Original file line number Diff line number Diff line change @@ -22,7 +22,8 @@ const startTagOpen = new RegExp(`^<${qnameCapture}`)
2222const startTagClose = / ^ \s * ( \/ ? ) > /
2323const endTag = new RegExp ( `^<\\/${ qnameCapture } [^>]*>` )
2424const doctype = / ^ < ! D O C T Y P E [ ^ > ] + > / i
25- const comment = / ^ < ! - - /
25+ // #7298: escape - to avoid being pased as HTML comment when inlined in page
26+ const comment = / ^ < ! \- - /
2627const conditionalComment = / ^ < ! \[ /
2728
2829let IS_REGEX_CAPTURING_BROKEN = false
@@ -152,7 +153,7 @@ export function parseHTML (html, options) {
152153 endTagLength = endTag . length
153154 if ( ! isPlainTextElement ( stackedTag ) && stackedTag !== 'noscript' ) {
154155 text = text
155- . replace ( / < ! - - ( [ \s \S ] * ?) - - > / g, '$1' )
156+ . replace ( / < ! \ -- ( [ \s \S ] * ?) - - > / g, '$1' ) // #7298
156157 . replace ( / < ! \[ C D A T A \[ ( [ \s \S ] * ?) ] ] > / g, '$1' )
157158 }
158159 if ( shouldIgnoreFirstNewline ( stackedTag , text ) ) {
You can’t perform that action at this time.
0 commit comments