Skip to content

Node Shape Passed to customizeTOC Not unified Standard #9

Open
@shellscape

Description

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.

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions