def html_to_plain_text(html):
<EOL>soup = BeautifulSoup(html, "<STR_LIT>")<EOL>parser = HTML2PlainParser()<EOL>parser.feed(str(soup.encode('<STR_LIT:utf-8>')))<EOL>result = parser.text.rstrip()<EOL>if parser.links:<EOL><INDENT>result += '<STR_LIT>'<EOL>for link in parser.links:<EOL><INDENT>result += '<STR_LIT>'.format(link[<NUM_LIT:0>], link[<NUM_LIT:1>])<EOL><DEDENT><DEDENT>return result<EOL>
Converts html code into formatted plain text.