diff --git a/src/calibre/ebooks/oeb/stylizer.py b/src/calibre/ebooks/oeb/stylizer.py index bead48ba01..dba9a388d6 100644 --- a/src/calibre/ebooks/oeb/stylizer.py +++ b/src/calibre/ebooks/oeb/stylizer.py @@ -133,8 +133,7 @@ class Stylizer(object): log=logging.getLogger('calibre.css')) self.font_face_rules = [] for elem in style_tags: - if (elem.tag == XHTML('style') and - elem.get('type', CSS_MIME) in OEB_STYLES and media_ok(elem.get('media'))): + if (elem.tag == XHTML('style') and elem.get('type', CSS_MIME) in OEB_STYLES and media_ok(elem.get('media'))): text = elem.text if elem.text else u'' for x in elem: t = getattr(x, 'text', None) @@ -171,11 +170,10 @@ class Stylizer(object): replaceUrls(stylesheet, item.abshref, ignoreImportRules=True) stylesheets.append(stylesheet) - elif (elem.tag == XHTML('link') and elem.get('href') and - elem.get('rel', 'stylesheet').lower() == 'stylesheet' and - elem.get('type', CSS_MIME).lower() in OEB_STYLES and - media_ok(elem.get('media')) - ): + elif (elem.tag == XHTML('link') and elem.get('href') and elem.get( + 'rel', 'stylesheet').lower() == 'stylesheet' and elem.get( + 'type', CSS_MIME).lower() in OEB_STYLES and media_ok(elem.get('media')) + ): href = urlnormalize(elem.attrib['href']) path = item.abshref(href) sitem = oeb.manifest.hrefs.get(path, None)