def escape_email_quoted_text(text, indent_txt='<STR_LIT>', linebreak_txt='<STR_LIT:\n>'):
washer = HTMLWasher()<EOL>lines = text.split(linebreak_txt)<EOL>output = '<STR_LIT>'<EOL>for line in lines:<EOL><INDENT>line = line.strip()<EOL>nb_indent = <NUM_LIT:0><EOL>while True:<EOL><INDENT>if line.startswith(indent_txt):<EOL><INDENT>nb_indent += <NUM_LIT:1><EOL>line = line[len(indent_txt):]<EOL><DEDENT>else:<EOL><INDENT>break<EOL><DEDENT><DEDENT>output += (nb_indent * indent_txt) + washer.wash(line,<EOL>render_unallowed_tags=True) + linebreak_txt<EOL>nb_indent = <NUM_LIT:0><EOL><DEDENT>return output[:-<NUM_LIT:1>]<EOL>
Escape text using an email-like indenting rule.
As an example, this text::
    >>Brave Sir Robin ran away...
    <img src="malicious_script />*No!*
    >>bravely ran away away...
    I didn't!*<script>malicious code</script>
    >>When danger reared its ugly head, he bravely turned his tail and fled.
    <form onload="malicious"></form>*I never did!*

will be escaped like this::
    >>Brave Sir Robin ran away...
    &lt;img src="malicious_script /&gt;*No!*
    >>bravely ran away away...
    I didn't!*&lt;script&gt;malicious code&lt;/script&gt;
    >>When danger reared its ugly head, he bravely turned his tail and fled.
    &lt;form onload="malicious"&gt;&lt;/form&gt;*I never did!*

@param text: the string to escape
@param indent_txt: the string used for quoting
@param linebreak_txt: in the text param, string used for linebreaks