jpuri / react-draft-wysiwyg

A Wysiwyg editor build on top of ReactJS and DraftJS. https://jpuri.github.io/react-draft-wysiwyg
MIT License
6.42k stars 1.16k forks source link

Text formatting generates invalid markdown #265

Open dininski opened 7 years ago

dininski commented 7 years ago

You are able to generate invalid markdown fairly easily. Simply write some bolded/emphasized text and add a whitespace at the end. This would generate the following: boldText which as you can see is invalid markdown. Instead it should generate **boldText** without a trailing whitespace after the text. Is there a workaround or an additional option necessary in order to fix this behavior?

jpuri commented 7 years ago

Hey @dininski: since the style is active at that point I think its valid markdown. To get markdown without the space you should remove inline styles from that position.

dininski commented 7 years ago

As per the commonmark spec (GitHub as well, in fact most specs) trailing whitespace should be trimmed, i.e. **text** is valid bold text in markdown and **text ** should not be bold.

stunningpixels commented 6 years ago

+1 on this, same problem with leading whitespace, eg:

Lorem ipsum dolor sit amet,** consectetur adipiscing elit**

jpuri commented 6 years ago

Hi All, sorry for the delay. I have been more busy with some personal urgencies last month, but slowly resuming thus project now. I will try to soon fix this.

dininski commented 5 years ago

Any progress on this?

anup-a commented 4 years ago

Still any Progress on this?

lambda121 commented 3 years ago

Is this fixed?