draft-convert icon indicating copy to clipboard operation
draft-convert copied to clipboard

After convertFromHtml span with whitespace doesn't keep the inline styles

Open dimkaufo opened this issue 4 years ago • 0 comments

Before convertFromHtml the content looks like this:

<p><span style="font-size: 55px">&nbsp;</span></p>

but after conversion it remove all the inline styles from the span with &nbsp; (like a font size in this case, so when I make the new line with space character of particular font size to have a kind of margin between the lines - it just reset it to default, so html in !== html out), why do it even touch it 🤔 (I mean it should be optional to trim the characters or removing the styles as it changes the content)?

The code that do that(starting point) is: https://github.com/HubSpot/draft-convert/blob/master/src/convertFromHTML.js#L309

dimkaufo avatar Aug 31 '20 07:08 dimkaufo