Skip to content

feat(core): turn whitespace removal on by default #22050

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

Closed
wants to merge 1 commit into from

Conversation

mhevery
Copy link
Contributor

@mhevery mhevery commented Feb 6, 2018

BREAKING CHANGE:

The defalut value for preserveWhitespaces has change from true to false. In most cases this should have no impact other than smaller payload. In some circumstances it may cause the render text to be missing space between words. For example: <span>Hello</span> <span>World</span> would
have the whitespace removed which would render as HelloWorld. For this reason the change is marked as breaking.

To fix the above situation there are two options:

  • Revert to preserve whitespace @Component({preserveWhitespaces: true}).
  • Manually insert non removable space &ngsp; (ng-space) into template: <span>Hello</span>&ngsp;<span>World</span>

PR Checklist

Please check if your PR fulfills the following requirements:

PR Type

What kind of change does this PR introduce?

[ ] Bugfix
[X] Feature
[ ] Code style update (formatting, local variables)
[ ] Refactoring (no functional changes, no api changes)
[ ] Build related changes
[ ] CI related changes
[ ] Documentation content changes
[ ] angular.io application / infrastructure changes
[ ] Other... Please describe:

What is the current behavior?

Issue Number: N/A

What is the new behavior?

Does this PR introduce a breaking change?

[X] Yes
[ ] No

Other information

BREAKING CHANGE:

The defalut value for `preserveWhitespaces` has change from `true` to `false`. In most cases this should have no impact other than smaller payload. In some circumstances it may cause the render text to be missing space between words. For example: `<span>Hello</span> <span>World</span>` would
have the whitespace removed which would render as `HelloWorld`. For this reason the change is marked as breaking.

To fix the above situation there are two options:
- Revert to preserve whitespace `@Component({preserveWhitespaces: true})`.
- Manually insert non removable space `&ngsp;` (ng-space) into template: `<span>Hello</span>&ngsp;<span>World</span>`
@mhevery mhevery requested a review from IgorMinar February 6, 2018 21:37
@mhevery mhevery added target: major This PR is targeted for the next major release action: review The PR is still awaiting reviews from at least one requested reviewer labels Feb 6, 2018
@benbraou
Copy link
Contributor

benbraou commented Feb 6, 2018

@mhevery sorry but is it possible to consider my PR #22046 ? It makes similar changes + doc updates

@mhevery
Copy link
Contributor Author

mhevery commented Feb 6, 2018

closing in favor of #22046

@benbraou
Copy link
Contributor

benbraou commented Feb 6, 2018

thank you!

@gkalpak
Copy link
Member

gkalpak commented Feb 7, 2018

closing in favor of #22046

It's still open...
Just saying 😃

@IgorMinar IgorMinar closed this Feb 7, 2018
@mhevery mhevery deleted the whitespace branch February 14, 2018 23:01
@angular-automatic-lock-bot
Copy link

This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators Sep 13, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
action: review The PR is still awaiting reviews from at least one requested reviewer cla: yes target: major This PR is targeted for the next major release
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants