Skip to content

Commit 76a83c5

Browse files
committed
fix(core registry): Do not scan TextNode content for patterns.
TextNode cannot hold markup, so there is also no needto scan those elements for patterns.
1 parent e1a044d commit 76a83c5

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/core/registry.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -150,6 +150,9 @@ const registry = {
150150

151151
if (typeof content === "string") {
152152
content = document.querySelector(content);
153+
} else if (content instanceof Text) {
154+
// No need to scan a TextNode.
155+
return;
153156
} else if (content.jquery) {
154157
content = content[0];
155158
}

0 commit comments

Comments
 (0)