Edit book: Automatic correction of font family names not quoting family names with spaces in them if the original, incorrect family name did not have a space. Fixes #1263448 [Problem with css auto-correct in editor](https://bugs.launchpad.net/calibre/+bug/1263448)

This commit is contained in:
Kovid Goyal 2013-12-22 14:54:26 +05:30
parent 4c158cb44b
commit 79f2a28457

View File

@ -31,6 +31,11 @@ def fix_declaration(style, css_name, font_name):
val = ff.item(i)
if val.value and val.value.lower() == css_name.lower():
val.value = font_name
# If val.type == 'IDENT' cssutils will not serialize the font
# name properly (it will not enclose it in quotes). There we
# use the following hack (setting an internal property of the
# Value class)
val._type = 'STRING'
changed = True
return changed