(node)
| 221 | } |
| 222 | |
| 223 | function sanitizeTextContent(node) { |
| 224 | if (node.nodeName === '#text') { |
| 225 | return node.value.trim() |
| 226 | } |
| 227 | |
| 228 | let sanitizedText = '' |
| 229 | |
| 230 | if (node.childNodes) { |
| 231 | for (const childNode of node.childNodes) { |
| 232 | sanitizedText += sanitizeTextContent(childNode) |
| 233 | } |
| 234 | } |
| 235 | |
| 236 | return sanitizedText |
| 237 | } |
| 238 | |
| 239 | function buildPath(node, path = '') { |
| 240 | const tag = node.nodeName |