This commit is contained in:
yanlong.wang 2024-08-01 19:48:00 +08:00
parent 6fb5df97cc
commit d0a922144d
No known key found for this signature in database
GPG Key ID: C0A623C0BADF9F37

View File

@ -126,7 +126,7 @@ function getMaxDepthAndCountUsingTreeWalker(root) {
const treeWalker = document.createTreeWalker(
root,
NodeFilter.SHOW_ELEMENT,
(node) => (node.nodeName.toLowerCase() === 'svg') ? NodeFilter.FILTER_REJECT : NodeFilter.FILTER_ACCEPT,
(node) => (node.nodeName.toLowerCase() === 'svg' || node.nodeName.toLowerCase() === 'code') ? NodeFilter.FILTER_REJECT : NodeFilter.FILTER_ACCEPT,
false
);