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:
Kovid Goyal 2013-06-20 10:20:39 +05:30
parent f964f512cf
commit b7d7a98fa6

View File

@ -18,7 +18,7 @@ from urlparse import urldefrag
from calibre import prepare_string_for_xml
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.utils.logging import default_log
@ -100,7 +100,7 @@ class OEB2HTML(object):
def rewrite_link(self, url, page=None):
if not page:
return url
abs_url = page.abshref(url)
abs_url = page.abshref(urlnormalize(url))
if abs_url in self.images:
return 'images/%s' % self.images[abs_url]
if abs_url in self.links: