kadikraman / draftjs-md-converter

Converts content from Draft.js blocks to Markdown and vice versa.
https://kadikraman.github.io/draftjs-md-converter/
MIT License
145 stars 37 forks source link

Don't ignore lengths of subchilds when calculating entity lengths #51

Closed benmccormick closed 4 years ago

benmccormick commented 4 years ago

Currently mdToDraftJS has a bug when considering nested styles/entities where it miscalculates lengths when things are nested. For instance, it views markdown like

[la**b**el](test.com) and says that the link has length 4 and offset 0 (because it considers **b** to have 0 length).

This PR adds 1 test and adjusts another test that had incorrect expectations to verify this behavior and adds a fix.

benmccormick commented 4 years ago

@kadikraman not sure if you're actively maintaining this repo nowadays, but it would be a huge help if we could get this in. Will greatly appreciate any time you have to check it out, and please let me know if there is any more info I can provide to make this easier. 🙏

benmccormick commented 4 years ago

@kadikraman just reaching out on this again. Any time you could give to moving this through would be greatly appreciated, or if you could let me know you're not actively maintaining this I can plan on finding a different workaround. Thanks!

benmccormick commented 4 years ago

@kadikraman Reaching out one more time on this, would be super helpful to have clarity on whether its realistic to expect to see this get in. Anything you can do would be appreciated!

kadikraman commented 4 years ago

Thanks for the PR! Looks good to me, I've published this in v1.3.0 🎉

benmccormick commented 4 years ago

Wonderful, thanks so much @kadikraman!