def clean_tag(data):
 return escape_html(data).replace('"', '&quot;').replace("'", '&#39')

def clean_tag ( data ) : return escape_html ( data ) . replace ( '"' , '&quot;' ) . replace ( "'" , '&#39' )
format as a valid tag .