sstur / draft-js-utils

DraftJS: import/export ContentState to and from HTML/Markdown

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Why to keep "\n" in html string ?

Flip437 opened this issue · comments

Why do you keep "\n" char in html string after
. This can create issues when using the string containing "\n" with a FormData e.g. (https://stackoverflow.com/questions/69835705/formdata-textarea-puts-r-carriage-return-when-sent-with-post)

+1!
I had an issue with this recently...
Draft editor had only 1 blank line between texts. After export, this one line looked like this ...</p>\n<p><br></p>\n<p>.... So many new lines...
I had html to text converter which converted this to 5 blank lines 🤣, instead of one... I think <p> tags were also treated as new lines as in css.