react-magic icon indicating copy to clipboard operation
react-magic copied to clipboard

White-space conversion on text nodes or inline elements

Open wkrueger opened this issue 6 years ago • 2 comments

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.

wkrueger avatar Dec 07 '18 09:12 wkrueger

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

Daniel15 avatar Mar 16 '19 07:03 Daniel15

Has anone fixed this?

PvanHengel avatar Nov 21 '20 18:11 PvanHengel