Skip to content

Commit ce904bf

Browse files
committed
core registry scan: Clean up selectors before querying.
1 parent b50415b commit ce904bf

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/core/registry.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,10 @@ const registry = {
140140
}
141141
}
142142

143-
let matches = dom.querySelectorAllAndMe(content, selectors.join(","));
143+
let matches = dom.querySelectorAllAndMe(
144+
content,
145+
selectors.map((it) => it.trim().replace(/,$/, "")).join(",")
146+
);
144147
matches = matches.filter((el) => {
145148
// Filter out code examples wrapped in <pre> elements.
146149
// Also filter special class ``.cant-touch-this``

0 commit comments

Comments
 (0)