Skip to content

Commit f39195a

Browse files
committed
fix: check text content for meaningful logic
1 parent b9ab9bd commit f39195a

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

src/helpers/clientSelectorGenerator.ts

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -564,16 +564,17 @@ class ClientSelectorGenerator {
564564
return true;
565565
}
566566

567-
if (element.children.length > 0) {
568-
return false;
569-
}
570-
571567
const text = (element.textContent || "").trim();
568+
const hasVisibleText = text.length > 0;
572569

573-
if (text.length > 0) {
570+
if (hasVisibleText || element.querySelector("svg")) {
574571
return true;
575572
}
576573

574+
if (element.children.length > 0) {
575+
return false;
576+
}
577+
577578
return false;
578579
}
579580

0 commit comments

Comments
 (0)