draftjs-to-html icon indicating copy to clipboard operation
draftjs-to-html copied to clipboard

Unnecessary new line \n character

Open tavyandy97 opened this issue 4 years ago • 4 comments

Hey @jpuri !

I was trying to convert a draft to html. While doing so, I was running to an issue that each block was seperated by a \n character. This seemed to be originating from https://github.com/jpuri/draftjs-to-html/blob/c02452e3ce6719f84f38d39f8f9b0a9e32bf871f/lib/draftjs-to-html.js#L615

Is there any workaround where the new line character is not the delimiter?

Thank you

tavyandy97 avatar Dec 26 '20 10:12 tavyandy97

totally agree. this is causing huge trouble when you set white-space: break-spaces; or pre-wrap.

iamswain25 avatar Apr 29 '21 17:04 iamswain25

+1

antonwestman avatar Apr 11 '22 14:04 antonwestman

+1

SomeBrujah avatar Oct 19 '22 19:10 SomeBrujah

@iamswain25 @antonwestman if I it will helps you use this regular for delete "\n" rawString.replace(/[\r\n]+/g, '')

SomeBrujah avatar Oct 19 '22 19:10 SomeBrujah