Replies: 2 comments 5 replies
-
I think you mean This behavior of what is and isn’t allowed is intentional. No way to change that. Existing documents were likely written for MDX 1 (or just plain markdown). For MDX 2, they’ll have to be changed. |
Beta Was this translation helpful? Give feedback.
-
I had to migrate some documents from mdx 1 to mdx 2 today and found the migration guide to be helpful. Since this discussion is ranking for search, I thought I'd add a link https://mdxjs.com/migrating/v2/#update-mdx-files |
Beta Was this translation helpful? Give feedback.
-
Hey fellas,
I'm having trouble parsing the following MDX content:
(Playground link: https://mdxjs.com/playground/)
The error: 'Expected a closing tag for (1:1-1:10) before the end of paragraph end-tag-mismatch mdast-util-mdx-jsx'
When I change the input MDX to the following it starts working:
However, I need to parse existing documents that are formatted in the way that throws an error. For example this MDX from Algolia's docs: https://raw.githubusercontent.com/algolia/docsearch/main/packages/website/docs/api.mdx
I thought perhaps I could prettify the MDX before passing it to the parser, but prettify doesn't always seems to format it correctly either: Sandbox example
Anyone has ideas how to approach this? Is there an option to relax the formatting rules or something like that?
Thank you
Beta Was this translation helpful? Give feedback.
All reactions