fix(core): escape overlapping comment delimiters in escapeCommentText · angular/angular@0eb2c24 · GitHub
Skip to content

Commit 0eb2c24

Browse files
committed
fix(core): escape overlapping comment delimiters in escapeCommentText
`COMMENT_DISALLOWED` is matched globally, so overlapping delimiter sequences are skipped: `<!-->` only escapes the leading `<!--` and leaves a live `-->` that can close a programmatically created comment node early. Drop the `^` anchors so a standalone `>`/`->` is escaped wherever it appears, which neutralizes the trailing delimiter left behind by an earlier match.
1 parent 40f7fbd commit 0eb2c24

2 files changed

Lines changed: 29 additions & 4 deletions

File tree

‎packages/core/src/util/dom.ts‎

Lines changed: 1 addition & 1 deletion

‎packages/core/test/util/dom_spec.ts‎

Lines changed: 28 additions & 3 deletions

0 commit comments

Comments
 (0)