function closeTag(endIndex, endPos) {
            lastClosedTag = stack[stack.length - 1];
            stack.pop();
            lastClosedTag.update();

            lastClosedTag.end = self.startOffset + endIndex;
            lastClosedTag.endPos = _addPos(self.startOffsetPos, endPos);
        }
Builds the SimpleDOM.

@param {?bool} strict if errors are detected, halt and return null
@param {?Object} markCache a cache that can be used in ID generation (is passed to `getID`)
@return {SimpleNode} root of tree or null if parsing failed