From 6cc4432cb71ac34fbfd7edc0780b19c90ec227b1 Mon Sep 17 00:00:00 2001 From: "Marshall T. Vandegrift" Date: Sat, 24 Jan 2009 22:24:11 -0500 Subject: [PATCH] Fix #1681. Handle HTML "style" attributes which begin with a ";". --- src/calibre/ebooks/oeb/stylizer.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/calibre/ebooks/oeb/stylizer.py b/src/calibre/ebooks/oeb/stylizer.py index 6549c8eccd..bf04133254 100644 --- a/src/calibre/ebooks/oeb/stylizer.py +++ b/src/calibre/ebooks/oeb/stylizer.py @@ -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):