fix: more comments

This commit is contained in:
Nolan Lawson 2023-12-10 12:41:17 -08:00
parent 068c3104a1
commit 810eb3650a
1 changed files with 3 additions and 1 deletions

View File

@ -206,8 +206,10 @@ function traverseAndSetupBindings (dom, boundExpressions) {
// find all comments once
foundComments = new Map()
for (const childNode of element.childNodes) {
// Note that minify-html-literals has already removed all non-framework comments
// But just to be safe, only look for comments that contain pure integers
let match
if (childNode.nodeType === Node.COMMENT_NODE && (match = /^placeholder-(\d+)/.exec(childNode.textContent))) {
if (childNode.nodeType === Node.COMMENT_NODE && (match = /^placeholder-(\d+)$/.exec(childNode.textContent))) {
foundComments.set(parseInt(match[1], 10), childNode)
}
}