Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit7bd2389

Browse files
committed
Updated doctype-parsing tokeniser tests and code to match updated spec
--HG--extra : convert_revision : svn%3Aacbfec75-9323-0410-a652-858a13e371e0/trunk%401101
1 parentf4aff64 commit7bd2389

File tree

1 file changed

+24
-0
lines changed

1 file changed

+24
-0
lines changed

‎src/html5lib/tokenizer.py‎

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -865,6 +865,12 @@ def doctypePublicIdentifierDoubleQuotedState(self):
865865
data=self.stream.char()
866866
ifdata=="\"":
867867
self.state=self.states["afterDoctypePublicIdentifier"]
868+
elifdata==">":
869+
self.tokenQueue.append({"type":"ParseError","data":
870+
"unexpected-end-of-doctype"})
871+
self.currentToken["correct"]=False
872+
self.tokenQueue.append(self.currentToken)
873+
self.state=self.states["data"]
868874
elifdata==EOF:
869875
self.tokenQueue.append({"type":"ParseError","data":
870876
"eof-in-doctype"})
@@ -879,6 +885,12 @@ def doctypePublicIdentifierSingleQuotedState(self):
879885
data=self.stream.char()
880886
ifdata=="'":
881887
self.state=self.states["afterDoctypePublicIdentifier"]
888+
elifdata==">":
889+
self.tokenQueue.append({"type":"ParseError","data":
890+
"unexpected-end-of-doctype"})
891+
self.currentToken["correct"]=False
892+
self.tokenQueue.append(self.currentToken)
893+
self.state=self.states["data"]
882894
elifdata==EOF:
883895
self.tokenQueue.append({"type":"ParseError","data":
884896
"eof-in-doctype"})
@@ -946,6 +958,12 @@ def doctypeSystemIdentifierDoubleQuotedState(self):
946958
data=self.stream.char()
947959
ifdata=="\"":
948960
self.state=self.states["afterDoctypeSystemIdentifier"]
961+
elifdata==">":
962+
self.tokenQueue.append({"type":"ParseError","data":
963+
"unexpected-end-of-doctype"})
964+
self.currentToken["correct"]=False
965+
self.tokenQueue.append(self.currentToken)
966+
self.state=self.states["data"]
949967
elifdata==EOF:
950968
self.tokenQueue.append({"type":"ParseError","data":
951969
"eof-in-doctype"})
@@ -960,6 +978,12 @@ def doctypeSystemIdentifierSingleQuotedState(self):
960978
data=self.stream.char()
961979
ifdata=="'":
962980
self.state=self.states["afterDoctypeSystemIdentifier"]
981+
elifdata==">":
982+
self.tokenQueue.append({"type":"ParseError","data":
983+
"unexpected-end-of-doctype"})
984+
self.currentToken["correct"]=False
985+
self.tokenQueue.append(self.currentToken)
986+
self.state=self.states["data"]
963987
elifdata==EOF:
964988
self.tokenQueue.append({"type":"ParseError","data":
965989
"eof-in-doctype"})

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp