angular/packages/core/src/sanitization
crisbeto 0100a39e21 fix(ivy): i18n instructions thrown off by sanitizer in IE11 (#34305)
While sanitizing on browsers that don't support the `template` element (pretty much only IE), we create an inert document and we insert content into it via `document.body.innerHTML = unsafeHTML`. The problem is that IE appears to parse the HTML passed to `innerHTML` differently, depending on whether the element has been inserted into a document or not. In particular, it seems to split some strings into multiple text nodes, which would've otherwise been a single node. This ended up throwing off some of the i18n code down the line and causing a handful of failures. I've worked around it by creating a new inert `body` element into which the HTML would be inserted.

PR Close #34305
2019-12-13 14:19:56 -08:00
..
bypass.ts fix(ivy): ExpressionChangedAfterItHasBeenCheckedError for SafeValue (#33749) 2019-11-15 10:44:23 -08:00
html_sanitizer.ts feat(core): add missing ARIA attributes to html sanitizer (#29685) 2019-04-25 12:30:55 -07:00
inert_body.ts fix(ivy): i18n instructions thrown off by sanitizer in IE11 (#34305) 2019-12-13 14:19:56 -08:00
readme.md refactor(core): move sanitization into core (#22540) 2018-03-07 18:24:06 -08:00
sanitization.ts fix(ivy): handle SafeStyles in [style.prop] correctly (#34286) 2019-12-10 10:32:27 -08:00
sanitizer.ts refactor(core): rename ngInjectableDef to ɵprov (#33151) 2019-10-16 16:36:19 -04:00
security.ts perf(core): make sanitization tree-shakable in Ivy mode (#31934) 2019-08-15 10:30:12 -07:00
style_sanitizer.ts fix(core): allow css custom variables/properties in the style sanitizer (#33841) 2019-11-20 14:47:59 -08:00
url_sanitizer.ts refactor(core): update docs (#29600) 2019-04-02 10:28:23 -07:00

Sanitization

This folder contains sanitization related code.

History

It used to be that sanitization related code used to be in @angular/platform-browser since it is platform related. While this is true, in practice the compiler schema is permanently tied to the DOM and hence the fact that sanitizer could in theory be replaced is not used in practice.

In order to better support tree shaking we need to be able to refer to the sanitization functions from the Ivy code. For this reason the code has been moved into the @angular/core.