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));
}