def strip_tags(html):
from html.parser import HTMLParser<EOL>class MLStripper(HTMLParser):<EOL><INDENT>"""<STR_LIT>"""<EOL>def __init__(self):<EOL><INDENT>try:<EOL><INDENT>super().__init__() <EOL><DEDENT>except TypeError as e:<EOL><INDENT>pass <EOL><DEDENT>self.reset()<EOL>self.fed = []<EOL><DEDENT>def handle_data(self, d):<EOL><INDENT>self.fed.append(d)<EOL><DEDENT>def get_data(self):<EOL><INDENT>return '<STR_LIT>'.join(self.fed)<EOL><DEDENT><DEDENT>s = MLStripper()<EOL>s.feed(html.replace("<STR_LIT>","<STR_LIT:U+0020>"))<EOL>return s.get_data()<EOL>
Stripts HTML tags from text.

    Note fields on several Mambu entities come with additional HTML tags
    (they are rich text fields, I guess that's why). Sometimes they are
    useless, so stripping them is a good idea.