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: {
|
properties: {
|
||||||
href: `#${headingId}`
|
href: `#${headingId}`
|
||||||
},
|
},
|
||||||
children: node.children
|
children: [{ type: 'text', value: nodeText }]
|
||||||
}
|
}
|
||||||
|
|
||||||
// Replace the heading's children with the new link element
|
// Replace the heading's children with the new link element
|
||||||
node.children = [linkElement]
|
node.children = [linkElement]
|
||||||
|
return [SKIP]
|
||||||
}
|
}
|
||||||
|
|
||||||
// if img is wrapped in a link, remove the link
|
// if img is wrapped in a link, remove the link
|
||||||
|
Loading…
x
Reference in New Issue
Block a user