def convert_markdown(message):
assert message['<STR_LIT:Content-Type>'].startswith("<STR_LIT>")<EOL>del message['<STR_LIT:Content-Type>']<EOL>message = make_message_multipart(message)<EOL>for payload_item in set(message.get_payload()):<EOL><INDENT>if payload_item['<STR_LIT:Content-Type>'].startswith('<STR_LIT>'):<EOL><INDENT>original_text = payload_item.get_payload()<EOL>html_text = markdown.markdown(original_text)<EOL>html_payload = future.backports.email.mime.text.MIMEText(<EOL>"<STR_LIT>".format(html_text),<EOL>"<STR_LIT:html>",<EOL>)<EOL>message.attach(html_payload)<EOL><DEDENT><DEDENT>return message<EOL>
Convert markdown in message text to HTML.