@@ -608,8 +608,8 @@ def markupDeclarationOpenState(self):
608
608
# Put in explicit EOF check
609
609
if (not EOF in charStack and
610
610
"" .join (charStack ).upper () == u"DOCTYPE" ):
611
- self .currentToken = {"type" :"Doctype" , "name" :"" , "publicId" : "" ,
612
- "systemId" : "" , "data " :True }
611
+ self .currentToken = {"type" :"Doctype" , "name" :"" ,
612
+ "publicId" : None , "systemId" : None , "correct " :True }
613
613
self .state = self .states ["doctype" ]
614
614
else :
615
615
self .tokenQueue .append ({"type" : "ParseError" , "data" :
@@ -689,11 +689,13 @@ def beforeDoctypeNameState(self):
689
689
elif data == u">" :
690
690
self .tokenQueue .append ({"type" : "ParseError" , "data" :
691
691
_ ("Unexpected > character. Expected DOCTYPE name." )})
692
+ self .currentToken ["correct" ] = False
692
693
self .tokenQueue .append (self .currentToken )
693
694
self .state = self .states ["data" ]
694
695
elif data == EOF :
695
696
self .tokenQueue .append ({"type" : "ParseError" , "data" :
696
697
_ ("Unexpected end of file. Expected DOCTYPE name." )})
698
+ self .currentToken ["correct" ] = False
697
699
self .tokenQueue .append (self .currentToken )
698
700
self .state = self .states ["data" ]
699
701
else :
@@ -725,7 +727,7 @@ def afterDoctypeNameState(self):
725
727
self .tokenQueue .append (self .currentToken )
726
728
self .state = self .states ["data" ]
727
729
elif data == EOF :
728
- self .currentToken ["data " ] = True
730
+ # XXX check spec ... self.currentToken["correct "] = False
729
731
self .stream .queue .append (data )
730
732
self .tokenQueue .append ({"type" : "ParseError" , "data" :
731
733
_ ("Unexpected end of file in DOCTYPE." )})
@@ -759,13 +761,13 @@ def beforeDoctypePublicIdentifierState(self):
759
761
elif data == ">" :
760
762
self .tokenQueue .append ({"type" : "ParseError" , "data" :
761
763
_ ("Unexpected end of DOCTYPE." )})
762
- self .currentToken ["data " ] = True
764
+ self .currentToken ["correct " ] = False
763
765
self .tokenQueue .append (self .currentToken )
764
766
self .state = self .states ["data" ]
765
767
elif data == EOF :
766
768
self .tokenQueue .append ({"type" : "ParseError" , "data" :
767
769
_ ("Unexpected end of file in DOCTYPE." )})
768
- self .currentToken ["data " ] = True
770
+ self .currentToken ["correct " ] = False
769
771
self .tokenQueue .append (self .currentToken )
770
772
self .state = self .states ["data" ]
771
773
else :
@@ -781,7 +783,7 @@ def doctypePublicIdentifierDoubleQuotedState(self):
781
783
elif data == EOF :
782
784
self .tokenQueue .append ({"type" : "ParseError" , "data" :
783
785
_ ("Unexpected end of file in DOCTYPE." )})
784
- self .currentToken ["data " ] = True
786
+ self .currentToken ["correct " ] = False
785
787
self .tokenQueue .append (self .currentToken )
786
788
self .state = self .states ["data" ]
787
789
else :
@@ -795,7 +797,7 @@ def doctypePublicIdentifierSingleQuotedState(self):
795
797
elif data == EOF :
796
798
self .tokenQueue .append ({"type" : "ParseError" , "data&q
F438
uot; :
797
799
_ ("Unexpected end of file in DOCTYPE." )})
798
- self .currentToken ["data " ] = True
800
+ self .currentToken ["correct " ] = False
799
801
self .tokenQueue .append (self .currentToken )
800
802
self .state = self .states ["data" ]
801
803
else :
@@ -816,7 +818,7 @@ def afterDoctypePublicIdentifierState(self):
816
818
elif data == EOF :
817
819
self .tokenQueue .append ({"type" : "ParseError" , "data" :
818
820
_ ("Unexpected end of file in DOCTYPE." )})
819
- self .currentToken ["data " ] = True
821
+ self .currentToken ["correct " ] = False
820
822
self .tokenQueue .append (self .currentToken )
821
823
self .state = self .states ["data" ]
822
824
else :
@@ -838,7 +840,7 @@ def beforeDoctypeSystemIdentifierState(self):
838
840
elif data == EOF :
839
841
self .tokenQueue .append ({"type" : "ParseError" , "data" :
840
842
_ ("Unexpected end of file in DOCTYPE." )})
841
- self .currentToken ["data " ] = True
843
+ self .currentToken ["correct " ] = False
842
844
self .tokenQueue .append (self .currentToken )
843
845
self .state = self .states ["data" ]
844
846
else :
@@ -854,7 +856,7 @@ def doctypeSystemIdentifierDoubleQuotedState(self):
854
856
elif data == EOF :
855
857
self .tokenQueue .append ({"type" : "ParseError" , "data" :
856
858
_ ("Unexpected end of file in DOCTYPE." )})
857
- self .currentToken ["data " ] = True
859
+ self .currentToken ["correct " ] = False
858
860
self .tokenQueue .append (self .currentToken )
859
861
self .state = self .states ["data" ]
860
862
else :
@@ -868,7 +870,7 @@ def doctypeSystemIdentifierSingleQuotedState(self):
868
870
elif data == EOF :
869
871
self .tokenQueue .append ({"type" : "ParseError" , "data" :
870
872
_ ("Unexpected end of file in DOCTYPE." )})
871
- self .currentToken ["data " ] = True
873
+ self .currentToken ["correct " ] = False
872
874
self .tokenQueue .append (self .currentToken )
873
875
self .state = self .states ["data" ]
874
876
else :
@@ -885,7 +887,7 @@ def afterDoctypeSystemIdentifierState(self):
885
887
elif data == EOF :
886
888
self .tokenQueue .append ({"type" : "ParseError" , "data" :
887
889
_ ("Unexpected end of file in DOCTYPE." )})
888
- self .currentToken ["data " ] = True
890
+ self .currentToken ["correct " ] = False
889
891
self .tokenQueue .append (self .currentToken )
890
892
self .state = self .states ["data" ]
891
893
else :
@@ -896,7 +898,7 @@ def afterDoctypeSystemIdentifierState(self):
896
898
897
899
def bogusDoctypeState (self ):
898
900
data = self .stream .char ()
899
- self .currentToken ["data " ] = True
901
+ self .currentToken ["correct " ] = False
900
902
if data == u">" :
901
903
self .tokenQueue .append (self .currentToken )
902
904
self .state = self .states ["data" ]
0 commit comments