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

Fix dupe text bug #15

Closed rickhanlonii closed 7 years ago

rickhanlonii commented 7 years ago

Overview

This PR fixes a bug where duplicate text was being inserted when converting from draftjs to markdown.

Closes #14

kadikraman commented 7 years ago

Looks good to me! I tried to fix this myself, but wasn't able to write a failing test for it. I think I kind of missed what the actual bug was, as I haven't been using draft.js for a while.

Thank you for fixing this bug (and the cheeky typo, haha)! 😊

rickhanlonii commented 7 years ago

No sweat @kadikraman!

Re: failing test -- did you try the test I added in the PR? Without these changes it should fail with:

kadikraman commented 7 years ago

@rickhanlonii Yeah I did try it locally :)

edit: to clarify, when this bug was first reported, I tried to fix it and the first step was for me to write a failing test for it. However since I misunderstood what the problem was, the test I wrote wouldn't fail. I tried yours before I merged it and now it makes sense.