mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-08 02:34:06 -04:00
Edit book: Font manager: Fix removing embedded font failing if @font-face rule has no src. Fixes #1847052 [Unable to remove font from font manager](https://bugs.launchpad.net/calibre/+bug/1847052)
This commit is contained in:
parent
9ee5bc98c5
commit
696a93deea
@ -91,7 +91,7 @@ def change_font_in_declaration(style, old_name, new_name=None):
|
|||||||
|
|
||||||
|
|
||||||
def remove_embedded_font(container, sheet, rule, sheet_name):
|
def remove_embedded_font(container, sheet, rule, sheet_name):
|
||||||
src = getattr(rule.style.getProperty('src'), 'value')
|
src = getattr(rule.style.getProperty('src'), 'value', None)
|
||||||
if src is not None:
|
if src is not None:
|
||||||
if src.startswith('url('):
|
if src.startswith('url('):
|
||||||
src = src[4:-1]
|
src = src[4:-1]
|
||||||
|
Loading…
x
Reference in New Issue
Block a user