(node: any)
| 62 | } |
| 63 | |
| 64 | function handleIncompleteComponent(node: any): boolean { |
| 65 | if (node.children.length !== 1 || node.children[0].type !== 'text') { |
| 66 | return false |
| 67 | } |
| 68 | |
| 69 | const textNode = node.children[0] |
| 70 | // Match incomplete components like :::componentName{ or :::componentName{incomplete |
| 71 | const incompleteMatch = textNode.value.match(/^\s*:::(\w+)(\{[^}]*)?\s*$/) |
| 72 | |
| 73 | if (incompleteMatch) { |
| 74 | node.children = [{ type: 'text', value: '' }] |
| 75 | return true |
| 76 | } |
| 77 | |
| 78 | return false |
| 79 | } |
| 80 | |
| 81 | function cleanTextContent(text: string): string { |
| 82 | return text.replace(/\s*:::(\w+)(\{[^}]*)?\s*$/, '').replace(/\}\s*$/g, '') |
no outgoing calls
no test coverage detected