You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Related to uiwjs#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.
当使用rehype-pretty-code提示Uncaught Error:
runSync
finished async. Userun
insteadThe text was updated successfully, but these errors were encountered: