@@ -1084,7 +1084,7 @@ def startTagHeading(self, token):
1084
1084
1085
1085
def startTagA (self , token ):
1086
1086
afeAElement = self .tree .elementInActiveFormattingElements ("a" )
1087
- if afeAElement :
1087
+ if afeAElement is not False :
1088
1088
self .parser .parseError ("unexpected-start-tag-implies-end-tag" ,
1089
1089
{"startName" : "a" , "endName" : "a" })
1090
1090
self .endTagFormatting (impliedTagToken ("a" ))
@@ -1407,7 +1407,7 @@ def endTagFormatting(self, token):
1407
1407
# - has the same tag name as the token.
1408
1408
formattingElement = self .tree .elementInActiveFormattingElements (
1409
1409
token ["name" ])
1410
- if (not formattingElement or
1410
+ if (formattingElement is False or
1411
1411
(formattingElement in self .tree .openElements and
1412
1412
not self .tree .elementInScope (formattingElement .name ))):
1413
1413
# If there is no such node, then abort these steps
@@ -1509,7 +1509,7 @@ def endTagFormatting(self, token):
1509
1509
node = clone
1510
1510
# Step 9.9
1511
1511
# Remove lastNode from its parents, if any
1512
- if lastNode .parent :
1512
+ if lastNode .parent is not None :
1513
1513
lastNode .parent .removeChild (lastNode )
1514
1514
node .appendChild (lastNode )
1515
1515
# Step 9.10
@@ -1519,7 +1519,7 @@ def endTagFormatting(self, token):
1519
1519
# Foster parent lastNode if commonAncestor is a
1520
1520
# table, tbody, tfoot, thead, or tr we need to foster
1521
1521
# parent the lastNode
1522
- if lastNode .parent :
1522
+ if lastNode .parent is not None :
1523
1523
lastNode .parent .removeChild (lastNode )
1524
1524
1525
1525
if commonAncestor .name in frozenset (("table" , "tbody" , "tfoot" , "thead" , "tr" )):
0 commit comments