don't allow other markup in headings
This commit is contained in:
parent
bbdc37ffd4
commit
2e1a7c1035
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue