AZW3 Output: Handle the case of the <guide> reference to a ToC containing an anchor correctly.

This commit is contained in:
Kovid Goyal 2013-03-21 13:29:13 +05:30
parent dff74b9314
commit 9c68d50e8e
2 changed files with 2 additions and 3 deletions

View File

@ -311,8 +311,7 @@ class AZW3Output(OutputFormatPlugin):
if not passthrough:
remove_html_cover(self.oeb, self.log)
# Split on pagebreaks so that the resulting KF8 works better with
# calibre's viewer, which does not support CSS page breaks
# Split on pagebreaks so that the resulting KF8 is faster to load
from calibre.ebooks.oeb.transforms.split import Split
Split()(self.oeb, self.opts)

View File

@ -47,7 +47,7 @@ class TOCAdder(object):
if 'toc' in oeb.guide:
# Remove spurious toc entry from guide if it is not in spine or it
# does not have any hyperlinks
href = urlnormalize(oeb.guide['toc'].href)
href = urlnormalize(oeb.guide['toc'].href.partition('#')[0])
if href in oeb.manifest.hrefs:
item = oeb.manifest.hrefs[href]
if (hasattr(item.data, 'xpath') and