From e63f8a2cb7a07cd821d12b4f8f4d7521de8a2572 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Tue, 21 Apr 2009 14:20:36 -0700 Subject: [PATCH] Unquote hrefs when creating OPF 2.0 --- src/calibre/ebooks/oeb/base.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/calibre/ebooks/oeb/base.py b/src/calibre/ebooks/oeb/base.py index 70303470d7..a36ad8f676 100644 --- a/src/calibre/ebooks/oeb/base.py +++ b/src/calibre/ebooks/oeb/base.py @@ -1026,7 +1026,7 @@ class Manifest(object): media_type = XHTML_MIME elif media_type in OEB_STYLES: media_type = CSS_MIME - attrib = {'id': item.id, 'href': item.href, + attrib = {'id': item.id, 'href': urlunquote(item.href), 'media-type': media_type} if item.fallback: attrib['fallback'] = item.fallback @@ -1238,7 +1238,7 @@ class Guide(object): def to_opf2(self, parent=None): elem = element(parent, OPF('guide')) for ref in self.refs.values(): - attrib = {'type': ref.type, 'href': ref.href} + attrib = {'type': ref.type, 'href': urlunquote(ref.href)} if ref.title: attrib['title'] = ref.title element(elem, OPF('reference'), attrib=attrib)