feat(security): add an HTML sanitizer.
This is based on Angular 1's implementation, parsing an HTML document into an inert DOM Document implementation, and then serializing only specifically whitelisted elements. It currently does not support SVG sanitization, all SVG elements are rejected. If available, the sanitizer uses the `<template>` HTML element as an inert container. Sanitization works client and server-side. Reviewers: rjamet, tbosch , molnarg , koto Differential Revision: https://reviews.angular.io/D108
This commit is contained in:
@ -56,6 +56,8 @@ export abstract class DomAdapter {
|
||||
abstract preventDefault(evt);
|
||||
abstract isPrevented(evt): boolean;
|
||||
abstract getInnerHTML(el): string;
|
||||
/** Returns content if el is a <template> element, null otherwise. */
|
||||
abstract getTemplateContent(el): any;
|
||||
abstract getOuterHTML(el): string;
|
||||
abstract nodeName(node): string;
|
||||
abstract nodeValue(node): string;
|
||||
|
Reference in New Issue
Block a user