Deschtex / html2react

A utility for turning raw HTML into React elements.
MIT License
43 stars 5 forks source link

don't trim whitespaces in text nodes #21

Closed gfx closed 6 years ago

gfx commented 7 years ago

Whitespaces are important for elements with style white-space: nowrap, or elements in <pre>, as the test case shows.

gfx commented 7 years ago

@Deschtex How about this?

Deschtex commented 7 years ago

Hey, @gfx. I'll have to verify that the change does not break current integrations.

gfx commented 7 years ago

@Deschtex Sure. I am using my fork until a new version is released.

gfx commented 7 years ago

@Deschtex How about this?

gfx commented 6 years ago

@Deschtex ping

gfx commented 6 years ago

I've re-invented the same-purpose module: https://github.com/bitjourney/react-from-html and it works well for my project, including in this PR's behavior.

Thanks.