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 69 forks source link

blank newlines in markdown don't convert to draft the same way as they do to markdown #37

Closed Rosey closed 6 years ago

Rosey commented 6 years ago

If you check out the example, when you modify the textarea, a newline always only counts as 1, even if you have 3 in a row.

But when you modify the draft editor, each newline is converted 1:1 to markdown. This behaviour is more desireable than the markdown-to-draft behaviour!

Rosey commented 6 years ago

I guess this is basically because of markdown syntax rules so it is "correct" although it feels whacky.

I'm going to pull request an option where users can enable non-collapsing whitespace if they so desire.

Rosey commented 6 years ago

Sorry I have a branch that does this but I'm still conflicted over whether this should even be an option since it kind of skews the rules of markdown, so I haven't PR'd it yet. So lmk if you're waiting on this or really want it!

juliankrispel commented 6 years ago

@Rosey I totally need/want this :D - or a client does, would be happy to help get it in :heart:

juliankrispel commented 6 years ago

sweeeeet thank you @Rosey 👍 👍 👍

Rosey commented 6 years ago

Let me know if you encounter any weirdness with it! Fingers crossed that is is bug free 🤞 😁

juliankrispel commented 6 years ago

@Rosey if there is I'll make a pr ✌️

juliankrispel commented 6 years ago

this is so perfectly on time btw 😍 thank you again!