mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-08 02:34:06 -04:00
HTMLZ Output: Fix handling of images with URL unsafe filenames
Fixes #1192687 [htmlz output not rewriting img and urls](https://bugs.launchpad.net/calibre/+bug/1192687)
This commit is contained in:
parent
f964f512cf
commit
b7d7a98fa6
@ -18,7 +18,7 @@ from urlparse import urldefrag
|
|||||||
|
|
||||||
from calibre import prepare_string_for_xml
|
from calibre import prepare_string_for_xml
|
||||||
from calibre.ebooks.oeb.base import XHTML, XHTML_NS, barename, namespace,\
|
from calibre.ebooks.oeb.base import XHTML, XHTML_NS, barename, namespace,\
|
||||||
OEB_IMAGES, XLINK, rewrite_links
|
OEB_IMAGES, XLINK, rewrite_links, urlnormalize
|
||||||
from calibre.ebooks.oeb.stylizer import Stylizer
|
from calibre.ebooks.oeb.stylizer import Stylizer
|
||||||
from calibre.utils.logging import default_log
|
from calibre.utils.logging import default_log
|
||||||
|
|
||||||
@ -100,7 +100,7 @@ class OEB2HTML(object):
|
|||||||
def rewrite_link(self, url, page=None):
|
def rewrite_link(self, url, page=None):
|
||||||
if not page:
|
if not page:
|
||||||
return url
|
return url
|
||||||
abs_url = page.abshref(url)
|
abs_url = page.abshref(urlnormalize(url))
|
||||||
if abs_url in self.images:
|
if abs_url in self.images:
|
||||||
return 'images/%s' % self.images[abs_url]
|
return 'images/%s' % self.images[abs_url]
|
||||||
if abs_url in self.links:
|
if abs_url in self.links:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user