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:
Kovid Goyal 2014-06-05 09:23:54 +05:30
parent 9418134ee8
commit ef8f3e006c

View File

@ -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