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

Angular remove some of html entities between tags #24217

Open
Dok11 opened this issue May 31, 2018 · 5 comments
Open

Angular remove some of html entities between tags #24217

Dok11 opened this issue May 31, 2018 · 5 comments
Labels
area: compiler Issues related to `ngc`, Angular's template compiler compiler: parser core: basic template syntax freq1: low P3 An issue that is relevant to core functions, but does not impede progress. Important, but not urgent state: confirmed type: bug/fix
Milestone

Comments

@Dok11
Copy link
Contributor

Dok11 commented May 31, 2018

I'm submitting a...


[x] Bug report  

Current behavior

Angular remove  ,   and maybe another html entites.

Expected behavior

Save my entities, please!

Minimal reproduction of the problem with instructions

https://stackblitz.com/edit/angular-vs-htmlentity?file=src/app/app.component.html
image

What is the motivation / use case for changing the behavior?

I want use all of html entities in my html templates.

Environment

Angular 5.2.0 and actual version at stackblitz.com

@pkozlowski-opensource
Copy link
Member

pkozlowski-opensource commented May 31, 2018

This is because of https://angular.io/api/core/Component#preserveWhitespaces which is activated by default in Angular 6.

You can opt out using various methods mentioned in the linked doc, ex.: https://stackblitz.com/edit/angular-vs-htmlentity-w4c7p9?file=src/app/app.component.html

I'm thinking that maybe the list of WS we've got (

const WS_CHARS = ' \f\n\r\t\v\u1680\u180e\u2000-\u200a\u2028\u2029\u202f\u205f\u3000\ufeff';
) is too eager and we should maybe remove \u2000-\u200a.

@pkozlowski-opensource pkozlowski-opensource added the area: core Issues related to the framework runtime label May 31, 2018
@ngbot ngbot bot added this to the needsTriage milestone May 31, 2018
@Dok11
Copy link
Contributor Author

Dok11 commented May 31, 2018

@pkozlowski-opensource one thing more about aio:
image

@Dok11
Copy link
Contributor Author

Dok11 commented May 31, 2018

I want say what  ,  ,   is not regular whitespaces which are in question in the documentation. They have own appointment and not intended for indention or something around in the html template like \s, \n, \t...

image

@echo-sean
Copy link

Related to issue: #21049

@pkozlowski-opensource
Copy link
Member

This is a confirmed bug in the whitespace removal - we should reduce the number of characters that are interpreted as whitespaces.

@jelbourn jelbourn added P3 An issue that is relevant to core functions, but does not impede progress. Important, but not urgent and removed severity3: broken labels Oct 1, 2020
@JoostK JoostK added area: compiler Issues related to `ngc`, Angular's template compiler compiler: parser and removed area: core Issues related to the framework runtime labels May 13, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: compiler Issues related to `ngc`, Angular's template compiler compiler: parser core: basic template syntax freq1: low P3 An issue that is relevant to core functions, but does not impede progress. Important, but not urgent state: confirmed type: bug/fix
Projects
None yet
Development

No branches or pull requests

7 participants