Permalink
Browse files

Fixed matching mixed case tags.

  • Loading branch information...
1 parent d770be5 commit 26a3b979dbd5b68fc5711a178af1842ec0ccd3ec @geca geca committed Dec 26, 2011
Showing with 2 additions and 2 deletions.
  1. +2 −2 lib/htmlparser.js
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();
}

0 comments on commit 26a3b97

Please sign in to comment.