-
Notifications
You must be signed in to change notification settings - Fork 26.2k
Aria attributes should not be stripped by html sanitizer #26815
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
Labels
Milestone
Comments
MartinMa
added a commit
to MartinMa/angular
that referenced
this issue
Apr 3, 2019
Allow ARIA attributes from the WAI-ARIA 1.1 spec which were stripped by the htmlSanitizer. Closes angular#26815
5 tasks
MartinMa
added a commit
to MartinMa/angular
that referenced
this issue
Apr 3, 2019
Allow ARIA attributes from the WAI-ARIA 1.1 spec which were stripped by the htmlSanitizer. Closes angular#26815
MartinMa
added a commit
to MartinMa/angular
that referenced
this issue
Apr 23, 2019
Allow ARIA attributes from the WAI-ARIA 1.1 spec which were stripped by the htmlSanitizer. Closes angular#26815
IgorMinar
pushed a commit
to MartinMa/angular
that referenced
this issue
Apr 25, 2019
Allow ARIA attributes from the WAI-ARIA 1.1 spec which were stripped by the htmlSanitizer. Closes angular#26815
BioPhoton
pushed a commit
to BioPhoton/angular
that referenced
this issue
May 21, 2019
) Allow ARIA attributes from the WAI-ARIA 1.1 spec which were stripped by the htmlSanitizer. Closes angular#26815 PR Close angular#29685
This issue has been automatically locked due to inactivity. Read more about our automatic conversation locking policy. This action has been performed automatically by a bot. |
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Labels
I'm submitting a...
Current behavior
Aria attributes like
aria-label
are being stripped by the html sanitizer as unsafe html.Expected behavior
Aria attributes should be treated as safe html and not be stripped, when used within
[innerHTML]
.For a list of supported attributes see https://www.w3.org/TR/html-aria/
Minimal reproduction of the problem with instructions
See https://stackblitz.com/edit/angular-wbkoxx
What is the motivation / use case for changing the behavior?
I'm loading translation strings from a json file (using
@ngx-translate/core
, since the built-in i18n support is missing important features). Some of them are pulled in via[innerHTML]
to keep html tags and attributes intact. Sadly, aria attributes are being stripped altogether.Is this on purpose? I could not find any hints in the docs or in the source.
Relevant line of code:
https://github.com/angular/angular/blob/master/packages/core/src/sanitization/html_sanitizer.ts#L69
Environment
Angular version: 7.0.1
Browser:
Any
The text was updated successfully, but these errors were encountered: