Dont ignore page rules in <style> tags

This commit is contained in:
Kovid Goyal 2018-05-31 12:01:05 +05:30
parent 5048ecbf84
commit bd3274ff4a
No known key found for this signature in database
GPG key ID: 06BC317B515ACE7C

View file

@ -12,7 +12,7 @@
from weakref import WeakKeyDictionary
from xml.dom import SyntaxErr as CSSSyntaxError
from cssutils.css import (CSSStyleRule, CSSPageRule, CSSFontFaceRule,
cssproperties, CSSRule)
cssproperties)
from cssutils import (profile as cssprofiles, parseString, parseStyle, log as
cssutils_log, CSSParser, profiles, replaceUrls)
from calibre import force_unicode, as_unicode
@ -163,8 +163,6 @@ def __init__(self, tree, path, oeb, opts, profile=None,
self.logger.warn('CSS @import of non-CSS file %r' % rule.href)
continue
stylesheets.append(sitem.data)
for rule in tuple(stylesheet.cssRules.rulesOfType(CSSRule.PAGE_RULE)):
stylesheet.cssRules.remove(rule)
# Make links to resources absolute, since these rules will
# be folded into a stylesheet at the root
replaceUrls(stylesheet, item.abshref,