reactjs / react-magic

Automatically AJAXify plain HTML with the power of React. It's magic!
Other
947 stars 100 forks source link

White-space conversion on text nodes or inline elements #161

Open wkrueger opened 5 years ago

wkrueger commented 5 years ago

https://github.com/facebook/react/issues/1643

React and HTML handle a bit differently when text nodes and the next element have a line break between them. HTML may add an extra whitespace. It even seems prettier also accounts for this since it also adds whitespaces sometimes when reformatting.

This allows for small possible layout differences between the original HTML and the generated JSX. For an "accurate" conversion, {" "}s or  s should be added on some cases.

Daniel15 commented 5 years ago

Would you be willing to submit a pull request to fix this?

PvanHengel commented 3 years ago

Has anone fixed this?