1 # -*- coding: utf-8 -*-
33 def strip(self, html):
34 # Convert htmlspecialchars
35 for escaped, unescaped in self.convertables.iteritems():
36 html = html.replace(escaped, unescaped)
38 # Strip everything of form <a>CONTENT</a>, but keep CONTENT (elements with content)
39 html = re.sub('<(?P<tag>.*?)>(?P<content>.*?)</(?P=tag)>', '\g<content>', html)
41 # Strip everything of form <a /> (elements without conent)
42 html = re.sub('<(.*?) />', '', html)