sstur / react-rte

Pure React rich text WYSIWYG editor based on draft-js.
https://react-rte.org
ISC License
2.86k stars 429 forks source link

Leading spaces breaks formatting #329

Open ckachelmeier opened 5 years ago

ckachelmeier commented 5 years ago

Adding 4 or more spaces at the beginning of a line breaks the markdown formatting.

Steps to reproduce:

1.) Navigate to the demo page or something similar. https://react-rte.org/demo 2.) Set it to markdown. 3.) Paste this string into the bottom textbox: test string. 4.) Observe the string will show up in the editor. 5.) Add another space to the beginning of the bottom textbox 6.) All the text will disappear in the editor.

harshavardhan-24 commented 3 years ago

Any Solution for above issue ?

ckachelmeier commented 3 years ago

@harshavardhan-24 We ended up switching to draft-js and a different format since markdown wasn't fulfilling our needs. But I believe we had a stop-gap solution that worked okay for react-rte. You can do a post-processing step to switch all spaces at the beginning of lines to  . It's possible that I'm mixing things up and that was something we had tried at a different stage of development, though.