Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

tableOfContents breaks when headings have nested tags (after webpack bundling) #55

Open
bensmithett opened this issue Aug 27, 2019 · 1 comment

Comments

@bensmithett
Copy link

Minimal reproduction here: https://github.com/bensmithett/mdx-error-repro
Example markdown: https://github.com/bensmithett/mdx-error-repro/blob/master/some_markdown.mdx
Example of what I'm trying to do with it: https://github.com/bensmithett/mdx-error-repro/blob/master/index.js#L19

If a heading other than a h1 has nested tags (e.g. code via backticks, italics via *) the tableOfContents expects a global MDXTag to exist.


I don't really know enough about how MDX works to make any intelligent suggestions, but...

Could this have something to do with it?

Also noticed the error actually makes it into the output bundle code so it's not just a runtime thing?

mdx_error

Thanks in advance 🙂

@jamesknelson
Copy link
Collaborator

The issue here appears to be that mdx-table-of-contents is using an outdated version of the mdx-js package.

It's possible that a fix could be as simple as upgrading the version of mdxjs, but given how much changed between the two versions, I think it would require a bit of work.

Unfortunately I don't have time to implement a fix right now, but would definitely accept a PR if you can get it working.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants