-
Notifications
You must be signed in to change notification settings - Fork 178
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
Support MDX v2 #478
Support MDX v2 #478
Conversation
@tgreyuk , are you interested in PR's against |
@jakeboone02 , it seems like MDX 2 is already planned to be part of the upcoming [email protected] |
Thanks @birkskyum. I'm wondering if they'll consider making the v3 branch compatible with MDX2 since v4 is kind of a big upgrade. The whole structure of the generated docs changes, some config options are different, etc. |
Apologies for the delayed response on this. @birkskyum correct MDX 2 is the default for V4 and there are tests against it. @jakeboone02 thanks for the initial PR. I have been looking at ways to accommodate this and although it appears an innocuous change I am reluctant to introduce this change in v3 and introduce unanticipated issues. I would recommend using v4 if MDX 2 support is required. However I understand that as this is potentially a big step so as a compromise I have written a local plugin that should provide MDX2 support for v3 without changing the core plugin. Please see https://github.com/tgreyuk/typedoc-plugin-markdown-mdx2/blob/main/README.md. Have a play and let me know if it might work as a compromise for you. On a side note I noticed that you went for html entity |
Thanks for the response @tgreyuk. I think a plugin would be sufficient. I've patched the package locally in my repo so I don't strictly require a fix for the moment. Actually when I submitted this PR I was unaware of v4, so I should have looked around more first. The reason I went with HTML entities was I couldn't actually get the
When I use The PR in my repo that uses MDX 2 is here: react-querybuilder/react-querybuilder#537. My local patch for v3 (which is basically the same as this PR) is here. FWIW I did try to upgrade to v4 but ran into the same problems. |
@tgreyuk - One more thing about the HTML entity vs backslash escape: The Docusaurus v3 migration guide says that MDX v1 will render
Seems like the HTML entity method is backwards compatible while the backslash escape method is not. |
The release of Docusaurus 3 has forced my hand on this so MDX2 is now supported in all versions. See #491. |
Closing as per comments. Thanks again for starting the conversation. |
This PR adjusts the output of
typedoc-plugin-markdown
to be compatible with MDX v2. Most of the changes are<
→<
and>
→>
.In my limited testing, these changes maintain compatibility with MDX v1.
I wasn't able to get the tests to pass in this repo—which may be a setup issue on my machine—but I did get rid of the warning about configuring
ts-jest
via theglobals
property.