File tree Expand file tree Collapse file tree 2 files changed +5
-4
lines changed Expand file tree Collapse file tree 2 files changed +5
-4
lines changed Original file line number Diff line number Diff line change 1116
1116
"ParseError" :7
1117
1117
}
1118
1118
1119
+ tagTokenTypes = frozenset ((tokenTypes ["StartTag" ], tokenTypes ["EndTag" ],
1120
+ tokenTypes ["EmptyTag" ]))
1119
1121
1120
1122
1121
1123
prefixes = dict ([(v ,k ) for k ,v in namespaces .iteritems ()])
Original file line number Diff line number Diff line change 13
13
from constants import entitiesWindows1252 , entities
14
14
from constants import asciiLowercase , asciiLetters , asciiUpper2Lower
15
15
from constants import digits , hexDigits , EOF
16
- from constants import tokenTypes
16
+ from constants import tokenTypes , tagTokenTypes
17
17
18
18
from inputstream import HTMLInputStream
19
19
@@ -276,8 +276,7 @@ def emitCurrentToken(self):
276
276
"""
277
277
token = self .currentToken
278
278
# Add token to the queue to be yielded
279
- if (token ["type" ] in (tokenTypes ["StartTag" ], tokenTypes ["EndTag" ],
280
- tokenTypes ["EmptyTag" ])):
279
+ if (token ["type" ] in tagTokenTypes ):
281
280
if self .lowercaseElementName :
282
281
token ["name" ] = token ["name" ].translate (asciiUpper2Lower )
283
282
if token ["type" ] == tokenTypes ["EndTag" ]:
@@ -294,7 +293,7 @@ def emitCurrentToken(self):
294
293
# Below are the various tokenizer states worked out.
295
294
296
295
def dataState (self ):
297
-
296
+ #XXX - consider splitting this state based on the content model flag
298
297
data = self .stream .char ()
299
298
300
299
# Keep a charbuffer to handle the escapeFlag
You can’t perform that action at this time.
0 commit comments