Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

proper trimming of trailing white spaces #219

Open
nippur72 opened this issue Apr 3, 2017 · 0 comments
Open

proper trimming of trailing white spaces #219

nippur72 opened this issue Apr 3, 2017 · 0 comments

Comments

@nippur72
Copy link
Contributor

nippur72 commented Apr 3, 2017

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant