Wrong results when parsing mixed-case tags #41

Closed
wants to merge 1 commit into
from
View
@@ -684,8 +684,8 @@ function DefaultHandler (callback, options) {
var baseName = element.name.substring(1);
if (!this.isEmptyTag(element)) {
var pos = this._tagStack.length - 1;
- while (pos > -1 && this._tagStack[pos--].name != baseName) { }
- if (pos > -1 || this._tagStack[0].name == baseName)
+ while (pos > -1 && this._tagStack[pos--].name.toLowerCase() != baseName.toLowerCase()) { }
+ if (pos > -1 || this._tagStack[0].name.toLowerCase() == baseName.toLowerCase())
while (pos < this._tagStack.length - 1)
this._tagStack.pop();
}