#NEWLINE# def __init__( self , permitted_tags = [ 'a' , 'b' , 'blockquote' , 'br/' , 'i' , 'li' , 'ol' , 'ul' , 'p' , 'cite' , 'code' , 'pre' , 'img/' ] , allowed_attributes = { #NEWLINE# #INDENT# 'a' : [ 'href' , 'title' ] , #NEWLINE# 'img' : [ 'src' , 'alt' ] , #NEWLINE# 'blockquote' : [ 'type' ] , #NEWLINE# #UNINDENT# } , fmt = AbstractFormatter , strip_disallowed = False ) : #NEWLINE# #INDENT# HTMLParser . __init__ ( self , fmt ) #NEWLINE# self . result = '' #NEWLINE# self . open_tags = [ ] #NEWLINE# self . permitted_tags = [ i for i in permitted_tags if ( i [ ( - 1 ) ] != '/' ) ] #NEWLINE# self . requires_no_close = [ i [ : ( - 1 ) ] for i in permitted_tags if ( i [ ( - 1 ) ] == '/' ) ] #NEWLINE# self . permitted_tags += self . requires_no_close #NEWLINE# self . allowed_attributes = allowed_attributes #NEWLINE# self . allowed_schemes = [ 'http' , 'https' , 'ftp' , 'mailto' ] #NEWLINE# self . strip_disallowed = strip_disallowed #NEWLINE# self . in_disallowed = False