riazXrazor / html-to-jsx

Converts html code to React JSX
MIT License
26 stars 7 forks source link

Text node whitespace behaviour #3

Open wkrueger opened 5 years ago

wkrueger commented 5 years ago

React (or JSX) intentionally "deviates" from HTML in which, when a text node encounters a line break, HTML will add a white space, but react wont.

Thats probably why sometimes prettier adds {' '} while reformatting.

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

It would be great if this extension also took that in consideration when converting.

Great work, thx

wkrueger commented 5 years ago

ok, this is on the shoulders of https://github.com/reactjs/react-magic

riazXrazor commented 5 years ago

@wkrueger yup thats correct i just wrapped it for to be used in vscode :), since i had to frequntly has to convert html to jsx