react-md-editor icon indicating copy to clipboard operation
react-md-editor copied to clipboard

Fix support for asynchronous plugins in rehypePlugins

Open vishwamartur opened this issue 1 year ago • 1 comments

Related to #662

Refactor Markdown component to support asynchronous plugins.

  • Markdown Component (core/src/components/TextArea/Markdown.tsx)

    • Import useState from React.
    • Add mdStr state to manage the processed markdown string.
    • Refactor useEffect to handle asynchronous processing of markdown using rehype().process.
    • Update the return statement to use mdStr state.
  • Example Component (www/src/Example.tsx)

    • Import rehypePrettyCode.
    • Add rehypePrettyCode to previewOptions.rehypePlugins.
  • Tests (test/editor.test.tsx)

    • Add a test to verify that MDEditor supports asynchronous plugins.
    • Use an example async plugin that adds a class to the first node.
    • Verify that the class is added to the preview node after processing.

vishwamartur avatar Nov 01 '24 07:11 vishwamartur

@vishwamartur is attempting to deploy a commit to the kenny wong's projects Team on Vercel.

A member of the Team first needs to authorize it.

vercel[bot] avatar Nov 01 '24 07:11 vercel[bot]

Any updates on this? I'd love to see it merged because I need to use async plugins.

JakeTrevor avatar Aug 18 '25 09:08 JakeTrevor