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.


trusted → dynamic

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()


NodeTreeSanitizer(NodeValidator validator)

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



hashCode int

Get a hash code for this object.

read-only, inherited
runtimeType Type

A representation of the runtime type of the object.

read-only, inherited


operator ==(other) bool

The equality operator.



noSuchMethod(Invocation invocation) → dynamic

Invoked when a non-existent method or property is accessed.

sanitizeTree(Node node) → void

Called with the root of the tree which is to be sanitized.

toString() String

Returns a string representation of this object.