-
Notifications
You must be signed in to change notification settings - Fork 739
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
Update MDX, support version 1 and 2, as well as the multiple ASTs generated #689
base: master
Are you sure you want to change the base?
Conversation
mdx version 1 and version 2 have different syntax tree, this allows both versions' syntax trees to be previewed. In addition, mdx internally uses multiple syntax trees. Version 1 has a markdown AST (mdast/remark) and an HTML AST (hast/rehype). Version 2 has a markdown AST (mdast/remark), an HTML AST (hast/rehype), and a JavaScript AST (esast/recma). This updates AST Explorer to have a preview for all version 1 and version 2 ASTs. As well as updates transformers to allow for transforms on both version 1 and version 2.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks! I really love astexplorer, but I miss MDX2 support
Any reason the old AST is still around? Why not drop it? |
I also wouldn't mind dropping the old AST |
A couple reasons.
I'd also be fine with dropping it, but defaulted to keeping it. |
Re 2: Old versions seems to be around to support old snippet links, they seem to be hidden: fad47c2 Re 1: MDX 0 and 1 ASTs, IMO, are more the “absence” of an AST. It’s mdast, but replaces a |
I suppose MDX 3 should be added by now too. |
mdx version 1 and version 2 have different syntax trees, this PR allows both versions' syntax trees to be previewed.
In addition, mdx internally uses multiple syntax trees.
Version 1 has:
Version 2 has:
This updates AST Explorer to have a preview for all version 1 and version 2 ASTs.
As well as updates transformers to allow for transforms on both version 1 and version 2.
This also adds support for syntax extensions, supported in MDX version 2; including GFM, Math, Directives, and more.
/cc @silvenon, @remcohaszing, @wooorm
Screenshots
mdx 2 preview with mdx 2 transformer
parser list for mdx
mdx 2 settings/plugins