MCPcopy Create free account
hub / github.com/CommandCodeAI/BaseAI / rehypeSlugify

Function rehypeSlugify

apps/baseai.dev/src/mdx/rehype.ts:61–70  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

59}
60
61export 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
72export function rehypeAddMDXExports(getExports: any) {
73 return (tree: any) => {

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected