NodeValidatorBuilder.common constructor

NodeValidatorBuilder.common()

Creates a new NodeValidatorBuilder which accepts common constructs.

By default this will accept HTML5 elements and attributes with the default UriPolicy and templating elements.

Notable syntax which is filtered:

  • Only known-good HTML5 elements and attributes are allowed.
  • All URLs must be same-origin, use allowNavigation and allowImages to specify additional URI policies.
  • Inline-styles are not allowed.
  • Custom element tags are disallowed, use allowCustomElement.
  • Custom tags extensions are disallowed, use allowTagExtension.
  • SVG Elements are not allowed, use allowSvg.

For scenarios where the HTML should only contain formatted text allowTextElements is more appropriate.

Use allowSvg to allow SVG elements.

Implementation

NodeValidatorBuilder.common() {
  allowHtml5();
  allowTemplating();
}