Hi! I'm using MDX with gatsby. I'm trying to update my system to MDX v2 but found three different plugins that no longer rendered content. The commonality I saw between all three were that they were creating a node of type html:
It seems as though something is breaking down on v2 when the node.type is "html".
Vague steps since I'm so far removed:
I think if you dive into the gatsby plugins, the emoji one should be the simplest (it wraps an emoji with a span that has an appropriate aria label!). So for that expected behviour: I'd expect a line with an emoji to render!
Empty <p> tag.
## Emoji
Emoji get proper a11y automatically! 💯
## Images
...

Hi there Katie! Thanks for such a detailed report.
The removal for html is in my opinion a feature, not a bug. In unified we have a better alternative for mapping markdown to “html”: hProperties, which works for all your “virtual dom” needs: GraphQL, React, Vue, etc, whereas a string of “html” doesn’t.
For some reason, Gatsby plugins never picked that up. I’ll start opening issues with them to update.
for mathjax: you can use remark-math as a remark plugin, and rehype-mathjax as a rehype plugin. No Gatsby-specificness needed.
For mermaid, there are also already remark plugins out there: https://github.com/search?q=remark+mermaid.
And I raised an issue for a11y-emoji, plus some other often used gatsby-remark plugins.
Anyway, I’ll close this because it is an intended change in a major version!
Thanks for the quick response and suggestions!
For any future readers, I ended up going with https://www.npmjs.com/package/rehype-accessible-emojis for my emojis. https://github.com/florianeckerstorfer/gatsby-remark-a11y-emoji has a similar package without gatsby that is https://github.com/florianeckerstorfer/remark-a11y-emoji but that wasn't able to work either because it still relied on an html node. Since rehype is dealing with hypertext abstract tree, that's the right time to introduce a span element that wraps emojis, not at the remark level.
Most helpful comment
for mathjax: you can use
remark-mathas a remark plugin, andrehype-mathjaxas a rehype plugin. No Gatsby-specificness needed.For mermaid, there are also already remark plugins out there: https://github.com/search?q=remark+mermaid.
And I raised an issue for a11y-emoji, plus some other often used gatsby-remark plugins.