The shape of the node object passed to customizeTOC doesn't match the Node interface as specified by the latest version of unified. This is what the plugin is passing:
{
type: 'element',
tagName: 'ol',
properties: { className: 'toc toc-level toc-level-1' },
children: [ [Object] ]
}
This is what unified expects:
interface Node {
type: string
data: Data?
position: Position?
}
As a result, we've no way to export the TOC using that method to stringify it, store the AST separately, etc.
The shape of the
nodeobject passed tocustomizeTOCdoesn't match theNodeinterface as specified by the latest version ofunified. This is what the plugin is passing:This is what unified expects:
As a result, we've no way to export the TOC using that method to stringify it, store the AST separately, etc.