mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Update Stylizer to use new cssutils property value validator.
This commit is contained in:
parent
78cadc9c3a
commit
04fba1d71a
@ -17,6 +17,7 @@ from xml.dom import SyntaxErr as CSSSyntaxError
|
||||
import cssutils
|
||||
from cssutils.css import CSSStyleRule, CSSPageRule, CSSStyleDeclaration, \
|
||||
CSSValueList, cssproperties
|
||||
from cssutils.profiles import profiles as cssprofiles
|
||||
from lxml import etree
|
||||
from lxml.cssselect import css_to_xpath, ExpressionError
|
||||
from calibre.ebooks.oeb.base import XHTML, XHTML_NS, CSS_MIME, OEB_STYLES
|
||||
@ -241,7 +242,7 @@ class Stylizer(object):
|
||||
primitives.reverse()
|
||||
value = primitives.pop()
|
||||
for key in composition:
|
||||
if cssproperties.cssvalues[key](value):
|
||||
if cssprofiles.validate(key, value):
|
||||
style[key] = value
|
||||
if not primitives: break
|
||||
value = primitives.pop()
|
||||
|
Loading…
x
Reference in New Issue
Block a user