React templates should properly trim trailing spaces when the text is on a different line respect to the enclosing tags. E.g.
<div>
Hello
</div>
should result in
<div>Hello</div>
when compiled.
Instead, as of today, it's rendered as:
<div> \n Hello \n</div> <!-- when normalizeHtmlWhiteSpace==false -->
<div> Hello </div> <!-- when normalizeHtmlWhiteSpace==true, notice the trailing extra spaces -->
I think we should align the behavior to what JSX compilers do, that is trim trailing spaces and newlines if the text spans over different lines. I can submit a PR if anyone is interested.
React templates should properly trim trailing spaces when the text is on a different line respect to the enclosing tags. E.g.
should result in
when compiled.
Instead, as of today, it's rendered as:
I think we should align the behavior to what JSX compilers do, that is trim trailing spaces and newlines if the text spans over different lines. I can submit a PR if anyone is interested.