fix: check text content for meaningful logic

This commit is contained in:
Rohit Rajan
2025-10-29 15:06:06 +05:30
parent b9ab9bd7c9
commit f39195a11c

View File

@@ -564,14 +564,15 @@ class ClientSelectorGenerator {
return true;
}
if (element.children.length > 0) {
return false;
const text = (element.textContent || "").trim();
const hasVisibleText = text.length > 0;
if (hasVisibleText || element.querySelector("svg")) {
return true;
}
const text = (element.textContent || "").trim();
if (text.length > 0) {
return true;
if (element.children.length > 0) {
return false;
}
return false;