Rosey / markdown-draft-js

A tool to convert content created in DraftJS to markdown and vice versa.
https://rosey.github.io/markdown-draft-js/
MIT License
318 stars 70 forks source link

Fix bugginess when converting draftjs trailing whitespace to markdown #31

Closed Rosey closed 7 years ago

Rosey commented 7 years ago

There was some code in place for this but it wasn't working in all cases. For inline styles like italic and bold, markdown doesn't play nice when the final few characters are whitepsace, so this checks for that and cuts it out, adds the closing markdown character, and then re-adds the trailing whitespace.


⭐️ Note: I'm going to have to add another PR to handle a related-but-different case that can happen: Leading WS. Markdown is equally unhappy with something like ** Test** but this current PR only checks for **Test **

Jpunt commented 7 years ago

Can you please release a new version for this?