From b7d7a98fa65eaa07d2225e74bcc8c4c4a7ebe365 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Thu, 20 Jun 2013 10:20:39 +0530 Subject: [PATCH] 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) --- src/calibre/ebooks/htmlz/oeb2html.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/calibre/ebooks/htmlz/oeb2html.py b/src/calibre/ebooks/htmlz/oeb2html.py index c6a7276f6c..b162d9e19c 100644 --- a/src/calibre/ebooks/htmlz/oeb2html.py +++ b/src/calibre/ebooks/htmlz/oeb2html.py @@ -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: