Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
dimkaufo opened this issue Aug 31, 2020 · 0 comments
Open

Comments

@dimkaufo
Copy link

dimkaufo commented Aug 31, 2020

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 dimkaufo changed the title Span with whitespace don't keep the inline styles After convertFromHtml span with whitespace doesn't keep the inline styles Aug 31, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant