Skip to content

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

Description

@dimkaufo

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions