File tree Expand file tree Collapse file tree 2 files changed +11
-0
lines changed
tests/AdvancedHTMLParserTests Expand file tree Collapse file tree 2 files changed +11
-0
lines changed Original file line number Diff line number Diff line change @@ -531,6 +531,8 @@ def getStartTag(self):
531531 if val :
532532 val = val .replace ('"' , '\\ "' )
533533 attributeString .append ('%s="%s"' % (name , val ) )
534+ else :
535+ attributeString .append (name )
534536
535537 if attributeString :
536538 attributeString = ' ' + ' ' .join (attributeString )
Original file line number Diff line number Diff line change @@ -105,5 +105,14 @@ def test_classNames(self):
105105 assert 'def' in tag .outerHTML , ' Failed to retain in outerHTML'
106106
107107
108+ def test_noValueAttributes (self ):
109+ parser = AdvancedHTMLParser ()
110+ parser .parseStr ('<input id="thebox" type="checkbox" checked />' )
111+
112+ tag = parser .getElementById ('thebox' )
113+ assert 'checked' in tag .attributes
114+ assert 'checked' in tag .outerHTML
115+
116+
108117if __name__ == '__main__' :
109118 pipe = subprocess .Popen ('GoodTests.py "%s"' % (sys .argv [0 ],), shell = True ).wait ()
You can’t perform that action at this time.
0 commit comments