Skip to content

Commit

Permalink
[tokenizer] fix case where < followed by whitespace doesn't parse c…
Browse files Browse the repository at this point in the history
…orrectly
  • Loading branch information
Zach Smith committed Jul 19, 2013
1 parent 529f727 commit 9f54942
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 1 deletion.
2 changes: 1 addition & 1 deletion lib/Tokenizer.js
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ Tokenizer.prototype.write = function(chunk){
} else if(this._state === BEFORE_TAG_NAME){
if(c === "/"){
this._state = BEFORE_CLOSING_TAG_NAME;
} else if(c === ">" || this._special > 0) {
} else if(c === ">" || this._special > 0 || whitespace(c)) {
this._state = TEXT;
} else {
if(whitespace(c));
Expand Down
16 changes: 16 additions & 0 deletions tests/Events/15-lt-whitespace.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{
"name": "lt followed by whitespace",
"options": {
"handler": {},
"parser": {}
},
"html": "a < b",
"expected": [
{
"event": "text",
"data": [
"a < b"
]
}
]
}

0 comments on commit 9f54942

Please sign in to comment.