This commit is contained in:
Samuel Clay 2019-07-28 18:28:13 -07:00
parent 2eccf8ad61
commit 971c4ddded

View file

@ -227,16 +227,16 @@ class Scrubber(object):
def _scrub_tag_font(self, node): def _scrub_tag_font(self, node):
attrs = {} attrs = {}
if hasattr(node, 'attrs') and isinstance(node.attrs, dict): if hasattr(node, 'attrs') and isinstance(node.attrs, dict):
for k, v in node.attrs: for k, v in node.attrs:
if k.lower() == 'size' and v.startswith('+'): if k.lower() == 'size' and v.startswith('+'):
# Remove "size=+0" # Remove "size=+0"
continue continue
attrs[k] = v attrs[k] = v
node.attrs = attrs node.attrs = attrs
if len(node.attrs) == 0: if len(node.attrs) == 0:
# IE renders font tags with no attributes differently then other browsers so remove them # IE renders font tags with no attributes differently then other browsers so remove them
return "keep_contents" return "keep_contents"
def _scrub_html_pre(self, html): def _scrub_html_pre(self, html):
"""Process the html before sanitization""" """Process the html before sanitization"""