remark-utils.ts9 lines · main
| 1 | // import type { RootContent } from 'mdast' |
| 2 | |
| 3 | export function flattenNode(node: any): string { |
| 4 | if ('children' in node) return node.children.map((child: any) => flattenNode(child)).join('') |
| 5 | |
| 6 | if ('value' in node) return node.value |
| 7 | |
| 8 | return '' |
| 9 | } |