def METHOD_NAME(self, doc):
    for tag, repl in self.html_tags.items():
        doc = re.sub(
            r"<%(tag)s>(.*?)</%(tag)s>" % {"tag": tag},
            r"%(repl)s\1%(repl)s" % {"repl": repl},
            doc,
            flags=re.DOTALL,
        )
    for html, text in self.html_chars.items():
        doc = re.sub(html, text, doc)
    return doc