code: function htmlParserImpl(html, handler) {
      if (html === null || html === undefined) {
        html = '';
      } else if (typeof html !== 'string') {
        html = '' + html;
      }
      inertBodyElement.innerHTML = html;
  
      //mXSS protection
      var mXSSAttempts = 5;
      do {
        if (mXSSAttempts === 0) {
          throw $sanitizeMinErr('uinput', 'Failed to sanitize html because the input is unstable');
        }
        mXSSAttempts--;
  
        // strip custom-namespaced attributes on IE<=11
        if (window.document.documentMode) {
          stripCustomNsAttrs(inertBodyElement);
        }
        html = inertBodyElement.innerHTML; //trigger mXSS
        inertBodyElement.innerHTML = html;
      } while (html !== inertBodyElement.innerHTML);
  
      var node = inertBodyElement.firstChild;
      while (node) {
        switch (node.nodeType) {
          case 1: // ELEMENT_NODE
            handler.start(node.nodeName.toLowerCase(), attrToMap(node.attributes));
            break;
          case 3: // TEXT NODE
            handler.chars(node.textContent);
            break;
        }
  
        var nextNode;
        if (!(nextNode = node.firstChild)) {
          if (node.nodeType === 1) {
            handler.end(node.nodeName.toLowerCase());
          }
          nextNode = node.nextSibling;
          if (!nextNode) {
            while (nextNode == null) {
              node = node.parentNode;
              if (node === inertBodyElement) break;
              nextNode = node.nextSibling;
              if (node.nodeType === 1) {
                handler.end(node.nodeName.toLowerCase());
              }
            }
          }
        }
        node = nextNode;
      }
  
      while ((node = inertBodyElement.firstChild)) {
        inertBodyElement.removeChild(node);
      }
    }
docs: @example
  htmlParser(htmlString, {
  start: function(tag, attrs) {},
  end: function(tag) {},
  chars: function(text) {},
  comment: function(text) {}
  });
  
  @param {string} html string
  @param {object} handler