allowTagExtension method

void allowTagExtension (
  1. String tagName,
  2. String baseName,
  3. {UriPolicy? uriPolicy,
  4. Iterable<String>? attributes,
  5. Iterable<String>? uriAttributes}
)

Allow custom tag extensions with the specified type name and specified attributes.

This will allow tag extensions (such as

), but will not allow custom tags. Use allowCustomElement to allow custom tags.

Implementation

void allowTagExtension(String tagName, String baseName,
    {UriPolicy? uriPolicy,
    Iterable<String>? attributes,
    Iterable<String>? uriAttributes}) {
  var baseNameUpper = baseName.toUpperCase();
  var tagNameUpper = tagName.toUpperCase();
  var attrs = attributes
      ?.map<String>((name) => '$baseNameUpper::${name.toLowerCase()}');
  var uriAttrs = uriAttributes
      ?.map<String>((name) => '$baseNameUpper::${name.toLowerCase()}');
  if (uriPolicy == null) {
    uriPolicy = new UriPolicy();
  }

  add(new _CustomElementNodeValidator(uriPolicy,
      [tagNameUpper, baseNameUpper], attrs, uriAttrs, true, false));
}

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