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

Bold styling is removing spaces #23

Closed zackary closed 7 years ago

zackary commented 7 years ago

I ran into an issue when the following combination was entered into the draftJS editor and then converted to markdown using the draftjsToMd function

Draft JS A [b] C [d] Want more

Markdown output A [b] C [d] Wantmore

DraftJS object screen shot 2017-07-19 at 3 20 41 pm

kadikraman commented 7 years ago

Hi @zackary - thanks for the incredibly detailed bug report, it's been super helpful. I've written a failing test based on it: https://github.com/kadikraman/draftjs-md-converter/pull/24

I'm pretty sure the culprit it this fixWhitespacesInsideStyle function which was introduced to fix a different whitespace issue. I'm looking into fixing this.

Edit: it was not the culprit at all, the problem was not resetting the offset back to 0 when whenever a new style paragraph is started 🎺

zackary commented 7 years ago

No problem @kadikraman. When do you think a fix will be completed by?

kadikraman commented 7 years ago

Ohh, I think I got it. Please confirm it works for you @zackary Should be fixed in v0.1.5

kadikraman commented 7 years ago

I'm closing this issue. Please reopen it if the problem persists.

zackary commented 7 years ago

Issue's resolved. Thanks!