(node: any)
| 165 | |
| 166 | // Helper function to extract text content from a node |
| 167 | function getTextContent(node: any): string { |
| 168 | if (node.type === "text") { |
| 169 | return node.value || ""; |
| 170 | } |
| 171 | |
| 172 | if (node.type === "element" && node.children) { |
| 173 | return node.children.map(getTextContent).join(""); |
| 174 | } |
| 175 | |
| 176 | return ""; |
| 177 | } |
| 178 | |
| 179 | // Process all child nodes |
| 180 | if (result.children) { |