-
Notifications
You must be signed in to change notification settings - Fork 100
HTML to MDAST #148
Comments
You mean rehype-parse & hast-util-to-mdast? |
@CanRau yeah, but sourcing wordpress content into the MDX pipeline as hast instead of raw markdown (skipping mdPlugins), then letting the plugins/etc run on it and replace rendering of elements with MDXProvider on the other end. |
I'm currently trying to get something similar to this, but this is coming from someone who is fairly ignorant to mdx, so be warned. It's probably important to note that we have no plans of having Wordpress function on the front end at all. We're actually returning our desired component string via Gutenberg, so that it shows up in wordpress' Because of this, our "content": "<p>Here is a gutenberg paragraph</p>\n\n<SomeComponent title=\"Testing\" />" In The more I'm learning about all this, the more I'm realizing how bad the above is. I'm realizing that The above is almost working, but I'm having a lot of issues getting |
So I think I just worked through my issue above, thanks to This still requires my manual loop through my string though, and an HTML to MDAST converter would probably be more efficient to use there. |
As part of the effort to transform HTML strings from WordPress with React components, it would be really helpful to build a utility to convert HTML to MDAST. From there, a pathway to create rehype plugins or Gatsby remark plugins would open up a lot of possibilities 😄
The text was updated successfully, but these errors were encountered: