HarryChen0506 / react-markdown-editor-lite

a light-weight Markdown editor based on React. 一款轻量的基于React的markdown编辑器
https://harrychen0506.github.io/react-markdown-editor-lite/
MIT License
1.02k stars 161 forks source link

[Feature request] option to render React node instead of HTML #272

Closed AustenLamacraft closed 1 year ago

AustenLamacraft commented 1 year ago

I'd like to render the preview using better-react-mathjax, which uses a component MathJax (the nice thing about this approach is that it takes care of the styles). Thus it would be good to have the option of rendering a React node instead of HTML in renderHTML.

AustenLamacraft commented 1 year ago

Turns out wrapping the whole editor component in <MathJax>...</MathJax> was all I needed (the editor text doesn't render)

sylingd commented 1 year ago

https://codesandbox.io/s/rmel-demo-ref-in-function-component-u04gb