allowTagExtension method

void allowTagExtension(String tagName, String baseName, { UriPolicy uriPolicy, Iterable<String> attributes, 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.

Source

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.dartlang.org/stable/1.24.3/dart-html/NodeValidatorBuilder/allowTagExtension.html