-
Notifications
You must be signed in to change notification settings - Fork 8
Can't get syntax highligth with draft-js-prism-plugin #2
Comments
Can you try providing an initial state that has code blocks? I'm running into the same issue, but haven't been able to get a small reproduction in-if the initial state has code blocks everything works fine though for some reason! |
OK, you mean using createFromBlockArray instead of CreateFromText ? |
Yeah, basically in my app it doesn't work if I start out with an empty editor, but if I hydrate content from the server it highlights perfectly fine? |
OK, it could be a great way to bypass it ! Let me know if I did right, I have the same problem with an initial content like:
|
Any news/updates on this? |
It's working for me now 🤷♂️ Our issue was that we were replacing the editor state, but decorators (what this plugin is using) are bound to the editor state in DraftJS. I think you just have to be extra careful to not replace the editor state ever after you add this plugin. (i.e. always call |
probably onChange is not triggered. if i set onChange as ()=>{} it doesnt hightlight. but if i update editorState at onChange it works for me.
|
Hi,
I face a serious issue using the prism-plugin.
I can't get any syntax highlighting ...
Any suggestion would be very, very appreciated :)
Thank you in advance,
Here is my source code:
The text was updated successfully, but these errors were encountered: