only use nodeType 1 and 3 (only relevant types)
parent
ab33b31f0a
commit
7e99626b14
|
@ -558,7 +558,7 @@
|
||||||
var text = "";
|
var text = "";
|
||||||
if(node.nodeType === 3) { //text node
|
if(node.nodeType === 3) { //text node
|
||||||
text += node.textContent;
|
text += node.textContent;
|
||||||
}else {
|
}else if (node.nodeType === 1) { //element node
|
||||||
var isAriaHidden = node.getAttribute('aria-hidden');
|
var isAriaHidden = node.getAttribute('aria-hidden');
|
||||||
var isDisplayHidden = window.getComputedStyle(node)['display'] === 'none';
|
var isDisplayHidden = window.getComputedStyle(node)['display'] === 'none';
|
||||||
if (isAriaHidden !== 'true' && !isDisplayHidden) {
|
if (isAriaHidden !== 'true' && !isDisplayHidden) {
|
||||||
|
|
Loading…
Reference in New Issue