mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
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:
parent
4c158cb44b
commit
79f2a28457
@ -31,6 +31,11 @@ def fix_declaration(style, css_name, font_name):
|
|||||||
val = ff.item(i)
|
val = ff.item(i)
|
||||||
if val.value and val.value.lower() == css_name.lower():
|
if val.value 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
|
||||||
|
# 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
|
changed = True
|
||||||
return changed
|
return changed
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user