()
| 59 | } |
| 60 | |
| 61 | export function rehypeSlugify() { |
| 62 | return (tree: any) => { |
| 63 | let slugify = slugifyWithCounter(); |
| 64 | visit(tree, 'element', node => { |
| 65 | if (node.tagName === 'h2' && !node.properties.id) { |
| 66 | node.properties.id = slugify(toString(node)); |
| 67 | } |
| 68 | }); |
| 69 | }; |
| 70 | } |
| 71 | |
| 72 | export function rehypeAddMDXExports(getExports: any) { |
| 73 | return (tree: any) => { |
nothing calls this directly
no outgoing calls
no test coverage detected