code: function patchOpenElementsStack(stack, parser) {
      var treeAdapter = parser.treeAdapter;
  
      stack.pop = function () {
          setEndLocation(this.current, parser.currentToken, treeAdapter);
          OpenElementStack.prototype.pop.call(this);
      };
  
      stack.popAllUpToHtmlElement = function () {
          for (var i = this.stackTop; i > 0; i--)
              setEndLocation(this.items[i], parser.currentToken, treeAdapter);
  
          OpenElementStack.prototype.popAllUpToHtmlElement.call(this);
      };
  
      stack.remove = function (element) {
          setEndLocation(element, parser.currentToken, treeAdapter);
          OpenElementStack.prototype.remove.call(this, element);
      };
  }
docs: NOTE: patch open elements stack, so we can assign end location for the elements