mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
EPUB viewer:Support quotes in the path to embedded font files
This commit is contained in:
parent
6175dca686
commit
1a98b0c266
@ -95,7 +95,7 @@ class EbookIterator(object):
|
|||||||
for match in re.compile(r'@font-face\s*{([^}]+)}').finditer(css):
|
for match in re.compile(r'@font-face\s*{([^}]+)}').finditer(css):
|
||||||
block = match.group(1)
|
block = match.group(1)
|
||||||
family = re.compile(r'font-family\s*:\s*([^;]+)').search(block)
|
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:
|
if url:
|
||||||
path = url.group(1).split('/')
|
path = url.group(1).split('/')
|
||||||
path = os.path.join(os.path.dirname(item.path), *path)
|
path = os.path.join(os.path.dirname(item.path), *path)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user