#NEWLINE# def strip( self , rawstring , escape = True ) : #NEWLINE# #INDENT# '\n        Returns the argument stripped of potentially harmful\n        HTML or Javascript code\n\n        @type escape: boolean\n        @param escape: If True (default) it escapes the potentially harmful\n          content, otherwise remove it\n        ' #NEWLINE# if ( not isinstance ( rawstring , str ) ) : #NEWLINE# #INDENT# return str ( rawstring ) #NEWLINE# #UNINDENT# for tag in self . requires_no_close : #NEWLINE# #INDENT# rawstring = rawstring . replace ( ( '<%s/>' % tag ) , ( '<%s />' % tag ) ) #NEWLINE# #UNINDENT# if ( not escape ) : #NEWLINE# #INDENT# self . strip_disallowed = True #NEWLINE# #UNINDENT# self . result = '' #NEWLINE# self . feed ( rawstring ) #NEWLINE# for endtag in self . open_tags : #NEWLINE# #INDENT# if ( endtag not in self . requires_no_close ) : #NEWLINE# #INDENT# self . result += ( '</%s>' % endtag ) #NEWLINE# #UNINDENT# #UNINDENT# return self . result