Skip to content

Commit

Permalink
Merge pull request tautologistics#38 from burl/master
Browse files Browse the repository at this point in the history
fix for script tags
  • Loading branch information
fb55 committed Apr 4, 2013
2 parents fcb35f0 + b7f6df5 commit 605aa6c
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 1 deletion.
2 changes: 2 additions & 0 deletions lib/Tokenizer.js
Expand Up @@ -150,9 +150,11 @@ Tokenizer.prototype.write = function(chunk){
this._emitToken("closetag");
this._state = TEXT;
this._sectionStart = this._index + 1;
this._special = 0;
} else if(whitespace(c)){
this._emitToken("closetag");
this._state = AFTER_CLOSING_TAG_NAME;
this._special = 0;
}
} else if(this._state === AFTER_CLOSING_TAG_NAME){
//skip everything until ">"
Expand Down
21 changes: 20 additions & 1 deletion tests/Events/02-template.json
Expand Up @@ -4,8 +4,21 @@
"handler": {},
"parser": {}
},
"html": "<script type=\"text/template\"><h1>Heading1</h1></script>",
"html": "<p><script type=\"text/template\"><h1>Heading1</h1></script></p>",
"expected": [
{
"event": "opentagname",
"data": [
"p"
]
},
{
"event": "opentag",
"data": [
"p",
{}
]
},
{
"event": "opentagname",
"data": [
Expand Down Expand Up @@ -39,6 +52,12 @@
"data": [
"script"
]
},
{
"event": "closetag",
"data": [
"p"
]
}
]
}

0 comments on commit 605aa6c

Please sign in to comment.