@@ -155,8 +155,8 @@ def consumeEntity(self, allowedChar=None, fromAttribute=False):
155155output = u"&"
156156
157157charStack = [self .stream .char ()]
158- if charStack [0 ]in spaceCharacters or charStack [0 ]in (EOF ,u"<" ,u"&" )\
159- or (allowedChar is not None and allowedChar == charStack [0 ]):
158+ if ( charStack [0 ]in spaceCharacters or charStack [0 ]in (EOF ,u"<" ,u"&" )
159+ or (allowedChar is not None and allowedChar == charStack [0 ]) ):
160160self .stream .unget (charStack [0 ])
161161
162162elif charStack [0 ]== u"#" :
@@ -620,10 +620,10 @@ def attributeValueUnQuotedState(self):
620620if data in spaceCharacters :
621621self .state = self .beforeAttributeNameState
622622elif data == u"&" :
623- self .processEntityInAttribute (None )
623+ self .processEntityInAttribute (">" )
624624elif data == u">" :
625625self .emitCurrentToken ()
626- elif data in (u'"' ,u"'" ,u"=" ,u"<" ) :
626+ elif data in (u'"' ,u"'" ,u"=" ,u"<" :
627627self .tokenQueue .append ({"type" :tokenTypes ["ParseError" ],"data" :
628628"unexpected-character-in-unquoted-attribute-value" })
629629self .currentToken ["data" ][- 1 ][1 ]+= data