lutra 0.1.18 → 0.1.19
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -137,8 +137,13 @@ export function matchOnType(el, e) {
|
|
137
137
|
const contentEl = el.querySelector("span.Content, label");
|
138
138
|
if (!contentEl)
|
139
139
|
return;
|
140
|
-
// Find all text nodes within contentEl
|
141
|
-
const walker = document.createTreeWalker(contentEl, NodeFilter.SHOW_TEXT,
|
140
|
+
// Find all text nodes within contentEl, excluding whitespace-only nodes
|
141
|
+
const walker = document.createTreeWalker(contentEl, NodeFilter.SHOW_TEXT, {
|
142
|
+
acceptNode: (node) => {
|
143
|
+
// Skip whitespace-only text nodes
|
144
|
+
return node.textContent?.trim() ? NodeFilter.FILTER_ACCEPT : NodeFilter.FILTER_REJECT;
|
145
|
+
}
|
146
|
+
});
|
142
147
|
let textNode;
|
143
148
|
let fullText = "";
|
144
149
|
const textNodes = [];
|