[v2] plugins not running with invalid HTML/JSX #1577
Labels
📚 area/docs
This affects documentation
🙋 no/question
This does not need any changes
💎 v2
Issues related to v2
I've successfully been using
next-mdx-remote
on a project, so upgraded the library locally to v2 to reap the benefits. Everything is going well, however I have ran into an "issue" which I was able to circumvent in v1.Im dealing with a situation where the MDX content is unknown, so I apply a few plugins to prevent misuse of the content.
For example, parsing the following MDX:
For this to be valid JSX, it should have a closing slash. Running this via
@mdx-js/mdx
throws the following error:In v1 I was able to write a quick plugin which scanned HTML elements and basically sanitised them:
This plugin looked something like:
A very hacky solution, but it worked for my use-case. However, after upgrading to v2 the plugins are simply not executed and the error is thrown straight away, not allowing me to modify the tree before being sent to the MDX compiler.
Obviously writing correct HTML/JSX would be the first step, but thought I'd highlight an upgrade "issue".
Thanks
The text was updated successfully, but these errors were encountered: