From 5ec4e24b0037f6825f469f226f290ffa0bd03e51 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Wed, 16 May 2012 13:34:47 +0530 Subject: [PATCH] EPUB Input: Correctly update the Cover entry in the ToC even when the entry has a fragment reference. Fixes #999973 (Private bug) --- src/calibre/ebooks/conversion/plugins/epub_input.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/calibre/ebooks/conversion/plugins/epub_input.py b/src/calibre/ebooks/conversion/plugins/epub_input.py index bb60412e1b..0dfbdb2a83 100644 --- a/src/calibre/ebooks/conversion/plugins/epub_input.py +++ b/src/calibre/ebooks/conversion/plugins/epub_input.py @@ -207,7 +207,7 @@ class EPUBInput(InputFormatPlugin): if rc: cover_toc_item = None for item in oeb.toc.iterdescendants(): - if item.href == rc: + if item.href and item.href.partition('#')[0] == rc: cover_toc_item = item break spine = {x.href for x in oeb.spine}