please help me previeRender
quyphan97 opened this issue · comments
I used react-markdown to customize the previewRender but when using mermaid not render
This is my codesandbox
@quyphan97 first of all. I'm not your servant to help you. "help me!!" doesn't seem to be much polite, but rather demanding.
Second of all, I'm a cool guy, so I'll still help you and give you some clues, but don't do this again as OSS doesn't mean I have to run and help you immediately.
Your Code
component uses useEffect
and it's not going to be executed when you runrenderToString
(console states that). So I think you have two options. One is to make a blocking operation without any effects and refs right in the render to get the UI you need. Or just use remark
with all plugins needed to output proper HTML without ReactMarkdown
wrapper. E.g. whatever markdown parser react-markdown
uses under the hood.
Oh sorry for that. I don't mean to be rude to you. Thank you for responding to my question
Thank you for giving me the solution, I did it, thanks a lot. Please clear this issue help me because I don't have permission
@quyphan97 all good. Issue is closed. Have a good day.
@RIP21 Hello, can you help me with this? how to insert text at the current cursor position and line, Thanks a lot
@quyphan97 look at the codemirror documentation. It's more likely related to codemirror.
Then you can get codemirror instance into your ref and manipulate editor textarea from it if I understand it correctly. I'm not familiar with such complex use cases :) So you need to investigate yourself :)
yes thank you very much, i found the solution before