W3cubDocs

/Dart 2

NodeTreeSanitizer class

Performs sanitization of a node tree after construction to ensure that it does not contain any disallowed elements or attributes.

In general custom implementations of this class should not be necessary and all validation customization should be done in custom NodeValidators, but custom implementations of this class can be created to perform more complex tree sanitization.

Constructors

NodeTreeSanitizer(NodeValidator validator)
factory
Constructs a default tree sanitizer which will remove all elements and attributes which are not allowed by the provided validator.

Properties

hashCodeint
read-only, inherited
The hash code for this object. [...]
runtimeTypeType
read-only, inherited
A representation of the runtime type of the object.

Methods

sanitizeTree(Node node) → void
Called with the root of the tree which is to be sanitized. [...]
noSuchMethod(Invocation invocation) → dynamic
inherited
Invoked when a non-existent method or property is accessed. [...]
toString() → String
inherited
Returns a string representation of this object.

Operators

operator ==(dynamic other) → bool
inherited
The equality operator. [...]

Constants

trusted → const _TrustedHtmlTreeSanitizer
A sanitizer for trees that we trust. It does no validation and allows any elements. It is also more efficient, since it can pass the text directly through to the underlying APIs without creating a document fragment to be sanitized.
const _TrustedHtmlTreeSanitizer()

© 2012 the Dart project authors
Licensed under the Creative Commons Attribution-ShareAlike License v4.0.
https://api.dart.dev/stable/2.5.0/dart-html/NodeTreeSanitizer-class.html