#NEWLINE# def handle_starttag( self , tag , attrs ) : #NEWLINE# #INDENT# attrs = [ ( ( name , ' ' . join ( sorted ( value . split ( ' ' ) ) ) ) if ( name == 'class' ) else ( name , value ) ) for ( name , value ) in self ] #NEWLINE# element = Element ( tag , attrs ) #NEWLINE# self . current . append ( element ) #NEWLINE# if ( tag not in self . SELF_CLOSING_TAGS ) : #NEWLINE# #INDENT# self . open_tags . append ( element ) #NEWLINE# #UNINDENT# self . element_positions [ element ] = self . getpos ( )