From 1a98b0c266827d6f7b584521cd5494c418b1ca9a Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Mon, 19 Jan 2009 09:58:44 -0800 Subject: [PATCH] EPUB viewer:Support quotes in the path to embedded font files --- src/calibre/ebooks/epub/iterator.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/calibre/ebooks/epub/iterator.py b/src/calibre/ebooks/epub/iterator.py index 08c275e81f..5601e9b8de 100644 --- a/src/calibre/ebooks/epub/iterator.py +++ b/src/calibre/ebooks/epub/iterator.py @@ -95,7 +95,7 @@ class EbookIterator(object): for match in re.compile(r'@font-face\s*{([^}]+)}').finditer(css): block = match.group(1) family = re.compile(r'font-family\s*:\s*([^;]+)').search(block) - url = re.compile(r'url\s*\((.+?)\)', re.DOTALL).search(block) + url = re.compile(r'url\s*\([\'"]*(.+?)[\'"]*\)', re.DOTALL).search(block) if url: path = url.group(1).split('/') path = os.path.join(os.path.dirname(item.path), *path)