Fix #1681. Handle HTML "style" attributes which begin with a ";".

This commit is contained in:
Marshall T. Vandegrift 2009-01-24 22:24:11 -05:00
parent ff5398c435
commit 6cc4432cb7

View File

@ -277,7 +277,10 @@ class Style(object):
def _apply_style_attr(self):
attrib = self._element.attrib
if 'style' in attrib:
style = CSSStyleDeclaration(attrib['style'])
css = attrib['style'].strip()
if css.startswith(';'):
css = css[1:]
style = CSSStyleDeclaration(css)
self._style.update(self._stylizer.flatten_style(style))
def _has_parent(self):