mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Dont ignore page rules in <style> tags
This commit is contained in:
parent
5048ecbf84
commit
bd3274ff4a
@ -12,7 +12,7 @@ import os, re, logging, copy, unicodedata
|
|||||||
from weakref import WeakKeyDictionary
|
from weakref import WeakKeyDictionary
|
||||||
from xml.dom import SyntaxErr as CSSSyntaxError
|
from xml.dom import SyntaxErr as CSSSyntaxError
|
||||||
from cssutils.css import (CSSStyleRule, CSSPageRule, CSSFontFaceRule,
|
from cssutils.css import (CSSStyleRule, CSSPageRule, CSSFontFaceRule,
|
||||||
cssproperties, CSSRule)
|
cssproperties)
|
||||||
from cssutils import (profile as cssprofiles, parseString, parseStyle, log as
|
from cssutils import (profile as cssprofiles, parseString, parseStyle, log as
|
||||||
cssutils_log, CSSParser, profiles, replaceUrls)
|
cssutils_log, CSSParser, profiles, replaceUrls)
|
||||||
from calibre import force_unicode, as_unicode
|
from calibre import force_unicode, as_unicode
|
||||||
@ -163,8 +163,6 @@ class Stylizer(object):
|
|||||||
self.logger.warn('CSS @import of non-CSS file %r' % rule.href)
|
self.logger.warn('CSS @import of non-CSS file %r' % rule.href)
|
||||||
continue
|
continue
|
||||||
stylesheets.append(sitem.data)
|
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
|
# Make links to resources absolute, since these rules will
|
||||||
# be folded into a stylesheet at the root
|
# be folded into a stylesheet at the root
|
||||||
replaceUrls(stylesheet, item.abshref,
|
replaceUrls(stylesheet, item.abshref,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user