Skip to content
Discussion options

You must be logged in to vote

I'm currently using this unified processor to convert a richtext pastebin to mdx automatically inside a textarea, but not sure if there's a better way to match how mdx compiles.

unified()
  .use(rehypeParse)
  .use(fixGoogleHtml)
  .use(rehypeRemark)
  .use(remarkGFM)
  .use(remarkStringify, {
    resourceLink: true,
    rule: "-",
    ruleRepetition: 5,
    fences: true,
  });

In the long term, I can imagine an mdx editor where "editing the live preview reflects the changes back into mdx" would be very powerful.

Replies: 2 comments 1 reply

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
1 reply
@wooorm
Comment options

Answer selected by xHomu
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants