don't allow other markup in headings

This commit is contained in:
k00b 2024-09-29 11:25:01 -05:00
parent bbdc37ffd4
commit 2e1a7c1035
1 changed files with 2 additions and 1 deletions

View File

@ -34,11 +34,12 @@ export default function rehypeSN (options = {}) {
properties: {
href: `#${headingId}`
},
children: node.children
children: [{ type: 'text', value: nodeText }]
}
// Replace the heading's children with the new link element
node.children = [linkElement]
return [SKIP]
}
// if img is wrapped in a link, remove the link