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

Support nested decorating and fixes markup highlighting #18

Closed nachocodoner closed 7 years ago

nachocodoner commented 7 years ago

I've been working with this plugin, I find it useful but sadly seems to be not maintained. Nonetheless, I've forked it to solve some issues around it, for you guys you can check it out and benefit from.

This PR supports nested decorating in order to solve render issues with the syntaxes that are tokenized recursively, such us the markup syntax. At the same time it encodes the markup string before decorating it for solving an error that unable us to see html highlightning correctly.

It also upgrades the prism and draftjs dependencies to the latest, and corrects the access of a block metadata.

mxstbr commented 7 years ago

I find it useful but sadly seems to be not maintained.

I've asked the original maintainer to give me commit and publish access so we can get this maintained again! :tada:

Would you mind rebasing your changes and adding some tests so I can understand what exactly your changes fix?

mxstbr commented 7 years ago

Since the changes in this PR were quite involved and I didn't quite understand the whys behind them I decided to merge #17, since it solves the original issue of highlighting markup.

If you're still interested in helping out, I'd love a followup PR with some of your improvements! Cheers, thanks for taking the time to contribute.