From 810eb3650aa7814134077598e8aa7e61b2704db4 Mon Sep 17 00:00:00 2001 From: Nolan Lawson Date: Sun, 10 Dec 2023 12:41:17 -0800 Subject: [PATCH] fix: more comments --- src/picker/components/Picker/framework.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/picker/components/Picker/framework.js b/src/picker/components/Picker/framework.js index a7a61f0..ae660fc 100644 --- a/src/picker/components/Picker/framework.js +++ b/src/picker/components/Picker/framework.js @@ -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) } }