Skip to content

Commit

Permalink
Updated tokeniser tests and Python to match r1306 of spec
Browse files Browse the repository at this point in the history
  • Loading branch information
excors committed Mar 3, 2008
1 parent 1b10b02 commit 069d796
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
5 changes: 4 additions & 1 deletion python/src/html5lib/tokenizer.py
Expand Up @@ -868,6 +868,7 @@ def afterDoctypeNameState(self):
self.tokenQueue.append({"type": "ParseError", "data":
"expected-space-or-right-bracket-in-doctype", "datavars":
{"data": data}})
self.currentToken["correct"] = False
self.state = self.states["bogusDoctype"]
return True

Expand Down Expand Up @@ -896,6 +897,7 @@ def beforeDoctypePublicIdentifierState(self):
else:
self.tokenQueue.append({"type": "ParseError", "data":
"unexpected-char-in-doctype"})
self.currentToken["correct"] = False
self.state = self.states["bogusDoctype"]
return True

Expand Down Expand Up @@ -961,6 +963,7 @@ def afterDoctypePublicIdentifierState(self):
else:
self.tokenQueue.append({"type": "ParseError", "data":
"unexpected-char-in-doctype"})
self.currentToken["correct"] = False
self.state = self.states["bogusDoctype"]
return True

Expand Down Expand Up @@ -989,6 +992,7 @@ def beforeDoctypeSystemIdentifierState(self):
else:
self.tokenQueue.append({"type": "ParseError", "data":
"unexpected-char-in-doctype"})
self.currentToken["correct"] = False
self.state = self.states["bogusDoctype"]
return True

Expand Down Expand Up @@ -1053,7 +1057,6 @@ def afterDoctypeSystemIdentifierState(self):

def bogusDoctypeState(self):
data = self.stream.char()
self.currentToken["correct"] = False
if data == u">":
self.tokenQueue.append(self.currentToken)
self.state = self.states["data"]
Expand Down
2 changes: 1 addition & 1 deletion testdata/tokenizer/test3.test
Expand Up @@ -214,7 +214,7 @@

{"description":"<!doctype! system\"\"?",
"input":"<!doctype! system\"\"?",
"output":["ParseError", "ParseError", "ParseError", ["DOCTYPE", "!", null, "", false]]},
"output":["ParseError", "ParseError", "ParseError", ["DOCTYPE", "!", null, "", true]]},

{"description":"<!doctype! system\"#",
"input":"<!doctype! system\"#",
Expand Down

0 comments on commit 069d796

Please sign in to comment.