Eyas / md-heading-id

Support for Heading ID Markdown Extensions
MIT License
17 stars 2 forks source link

Getting error parsing mdx with heading id in v2 #11

Open vrepsys opened 3 weeks ago

vrepsys commented 3 weeks ago

Hey there, is the v2 functional? I just upgraded and below code throws an error:

import { remarkHeadingId } from 'remark-custom-heading-id'
    const ast = remark()
      .use(remarkMdx)
      .use(remarkHeadingId)
      .parse('# markdown {#headingid}')

I'm using the latest remark and mdx Getting:

    TypeError: Cannot set properties of undefined (setting 'value')

       7 |     .use(remarkMdx)
       8 |     .use(remarkHeadingId)
    >  9 |     .parse('# markdown {#headingid}')
         |      ^
      10 | })
      11 |

      at Object.idString (../../node_modules/mdast-heading-id/index.js:20:20)
      at compile (../../node_modules/remark-parse/node_modules/mdast-util-from-markdown/lib/index.js:337:40)
      at fromMarkdown (../../node_modules/remark-parse/node_modules/mdast-util-from-markdown/lib/index.js:173:27)
      at parser (../../node_modules/remark-parse/lib/index.js:33:12)
      at Function.parse (../../node_modules/unified/lib/index.js:668:12)
      at Object.<anonymous> (test/heading-id.docusaurus.test.ts:9:6)

Or am I missing something?

Really appreciate any help and advice!