mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-07 10:14:46 -04:00
Check Book: Fix combination of mismatching font family names and a font-family declaration with an invalid value (such as a dimension) causing auto fixing of errors to fail. Fixes #1325070 [Private bug](https://bugs.launchpad.net/calibre/+bug/1325070)
This commit is contained in:
parent
9418134ee8
commit
ef8f3e006c
@ -30,7 +30,7 @@ def fix_declaration(style, css_name, font_name):
|
|||||||
if ff is not None:
|
if ff is not None:
|
||||||
for i in xrange(ff.length):
|
for i in xrange(ff.length):
|
||||||
val = ff.item(i)
|
val = ff.item(i)
|
||||||
if val.value and val.value.lower() == css_name.lower():
|
if hasattr(val.value, 'lower') and val.value.lower() == css_name.lower():
|
||||||
val.value = font_name
|
val.value = font_name
|
||||||
# If val.type == 'IDENT' cssutils will not serialize the font
|
# If val.type == 'IDENT' cssutils will not serialize the font
|
||||||
# name properly (it will not enclose it in quotes). There we
|
# name properly (it will not enclose it in quotes). There we
|
||||||
|
Loading…
x
Reference in New Issue
Block a user