SamyPesse / draft-js-prism

Code highlighting for DraftJS using Prism
http://samypesse.github.io/draft-js-prism/
Apache License 2.0
275 stars 36 forks source link

When having several lines of code, not highlighted properly #28

Open mrnaia opened 3 years ago

mrnaia commented 3 years ago

Hi,

We discovered an issue of highlighting when we have same line of code on several lines.

For example, if I have in my code snippet:

<Button
  prop1={'string'}
  prop2=false
>
  {children}
</Button>

The Button will not be highlighted and understood correctly. It's like Prism is applied on each line separately instead of being applied on the whole code snippet element.

Let me know if you need more details.

zhllucky commented 1 year ago

I think you should handle functions like 'handleReturn' yourself in your editor. I'm not sure why, but the library's author didn't address this issue for us.