vendor/ember-leaflet-cartodb/cartodb_noleaflet.js
function sanitize(htmlText, opt_uriPolicy, opt_nmTokenPolicy) {
    var out = [];
    makeHtmlSanitizer(
      function sanitizeAttribs(tagName, attribs) {
        for (var i = 0; i < attribs.length; i += 2) {
          var attribName = attribs[i];
          var value = attribs[i + 1];
          var atype = null, attribKey;
          if ((attribKey = tagName + '::' + attribName,
               html4.ATTRIBS.hasOwnProperty(attribKey))
              || (attribKey = '*::' + attribName,
                  html4.ATTRIBS.hasOwnProperty(attribKey))) {
            atype = html4.ATTRIBS[attribKey];
          }
          if (atype !== null) {
            switch (atype) {
              case html4.atype.NONE: break;
              case html4.atype.SCRIPT:
              case html4.atype.STYLE:
                value = null;
                break;
              case html4.atype.ID:
              case html4.atype.IDREF:
              case html4.atype.IDREFS:
              case html4.atype.GLOBAL_NAME:
              case html4.atype.LOCAL_NAME:
              case html4.atype.CLASSES:
                value = opt_nmTokenPolicy ? opt_nmTokenPolicy(value) : value;
                break;
              case html4.atype.URI:
                var parsedUri = ('' + value).match(URI_SCHEME_RE);
                if (!parsedUri) {
                  value = null;
                } else if (!parsedUri[1] ||
                    WHITELISTED_SCHEMES.test(parsedUri[1])) {
                  value = opt_uriPolicy && opt_uriPolicy(value);
                } else {
                  value = null;
                }
                break;
              case html4.atype.URI_FRAGMENT:
                if (value && '#' === value.charAt(0)) {
                  value = opt_nmTokenPolicy ? opt_nmTokenPolicy(value) : value;
                  if (value) { value = '#' + value; }
                } else {
                  value = null;
                }
                break;
              default:
                value = null;
                break;
            }
          } else {
            value = null;
          }
          attribs[i + 1] = value;
        }
        return attribs;
      })(htmlText, out);
    return out.join('');
  }
function sanitize(htmlText, opt_uriPolicy, opt_nmTokenPolicy) {
    var out = [];
    makeHtmlSanitizer(
      function sanitizeAttribs(tagName, attribs) {
        for (var i = 0; i < attribs.length; i += 2) {
          var attribName = attribs[i];
          var value = attribs[i + 1];
          var atype = null, attribKey;
          if ((attribKey = tagName + '::' + attribName,
               html4.ATTRIBS.hasOwnProperty(attribKey))
              || (attribKey = '*::' + attribName,
                  html4.ATTRIBS.hasOwnProperty(attribKey))) {
            atype = html4.ATTRIBS[attribKey];
          }
          if (atype !== null) {
            switch (atype) {
              case html4.atype.NONE: break;
              case html4.atype.SCRIPT:
              case html4.atype.STYLE:
                value = null;
                break;
              case html4.atype.ID:
              case html4.atype.IDREF:
              case html4.atype.IDREFS:
              case html4.atype.GLOBAL_NAME:
              case html4.atype.LOCAL_NAME:
              case html4.atype.CLASSES:
                value = opt_nmTokenPolicy ? opt_nmTokenPolicy(value) : value;
                break;
              case html4.atype.URI:
                var parsedUri = ('' + value).match(URI_SCHEME_RE);
                if (!parsedUri) {
                  value = null;
                } else if (!parsedUri[1] ||
                    WHITELISTED_SCHEMES.test(parsedUri[1])) {
                  value = opt_uriPolicy && opt_uriPolicy(value);
                } else {
                  value = null;
                }
                break;
              case html4.atype.URI_FRAGMENT:
                if (value && '#' === value.charAt(0)) {
                  value = opt_nmTokenPolicy ? opt_nmTokenPolicy(value) : value;
                  if (value) { value = '#' + value; }
                } else {
                  value = null;
                }
                break;
              default:
                value = null;
                break;
            }
          } else {
            value = null;
          }
          attribs[i + 1] = value;
        }
        return attribs;
      })(htmlText, out);
    return out.join('');
  }
function sanitize ( htmlText , opt_uriPolicy , opt_nmTokenPolicy ) { var out = [ ] ; makeHtmlSanitizer ( function sanitizeAttribs ( tagName , attribs ) { for ( var i = 0 ; i < attribs . length ; i += 2 ) { var attribName = attribs [ i ] ; var value = attribs [ i + 1 ] ; var atype = null , attribKey ; if ( ( attribKey = tagName + '::' + attribName , html4 . ATTRIBS . hasOwnProperty ( attribKey ) ) || ( attribKey = '*::' + attribName , html4 . ATTRIBS . hasOwnProperty ( attribKey ) ) ) { atype = html4 . ATTRIBS [ attribKey ] ; } if ( atype !== null ) { switch ( atype ) { case html4 . atype . NONE : break ; case html4 . atype . SCRIPT : case html4 . atype . STYLE : value = null ; break ; case html4 . atype . ID : case html4 . atype . IDREF : case html4 . atype . IDREFS : case html4 . atype . GLOBAL_NAME : case html4 . atype . LOCAL_NAME : case html4 . atype . CLASSES : value = opt_nmTokenPolicy ? opt_nmTokenPolicy ( value ) : value ; break ; case html4 . atype . URI : var parsedUri = ( '' + value ) . match ( URI_SCHEME_RE ) ; if ( ! parsedUri ) { value = null ; } else if ( ! parsedUri [ 1 ] || WHITELISTED_SCHEMES . test ( parsedUri [ 1 ] ) ) { value = opt_uriPolicy && opt_uriPolicy ( value ) ; } else { value = null ; } break ; case html4 . atype . URI_FRAGMENT : if ( value && '#' === value . charAt ( 0 ) ) { value = opt_nmTokenPolicy ? opt_nmTokenPolicy ( value ) : value ; if ( value ) { value = '#' + value ; } } else { value = null ; } break ; default : value = null ; break ; } } else { value = null ; } attribs [ i + 1 ] = value ; } return attribs ; } ) ( htmlText , out ) ; return out . join ( '' ) ; }
Strips unsafe tags and attributes from html.
@param {string} htmlText to sanitize
@param {Function} opt_uriPolicy -- a transform to apply to uri/url
attribute values.  If no opt_uriPolicy is provided, no uris
are allowed ie. the default uriPolicy rewrites all uris to null
@param {Function} opt_nmTokenPolicy : string -> string? -- a transform to
apply to names, ids, and classes. If no opt_nmTokenPolicy is provided,
all names, ids and classes are passed through ie. the default
nmTokenPolicy is an identity transform
@return {string} html
Strips unsafe tags and attributes from html .