mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
AZW3 Output: Handle the case of the <guide> reference to a ToC containing an anchor correctly.
This commit is contained in:
parent
dff74b9314
commit
9c68d50e8e
@ -311,8 +311,7 @@ class AZW3Output(OutputFormatPlugin):
|
|||||||
if not passthrough:
|
if not passthrough:
|
||||||
remove_html_cover(self.oeb, self.log)
|
remove_html_cover(self.oeb, self.log)
|
||||||
|
|
||||||
# Split on pagebreaks so that the resulting KF8 works better with
|
# Split on pagebreaks so that the resulting KF8 is faster to load
|
||||||
# calibre's viewer, which does not support CSS page breaks
|
|
||||||
from calibre.ebooks.oeb.transforms.split import Split
|
from calibre.ebooks.oeb.transforms.split import Split
|
||||||
Split()(self.oeb, self.opts)
|
Split()(self.oeb, self.opts)
|
||||||
|
|
||||||
|
@ -47,7 +47,7 @@ class TOCAdder(object):
|
|||||||
if 'toc' in oeb.guide:
|
if 'toc' in oeb.guide:
|
||||||
# Remove spurious toc entry from guide if it is not in spine or it
|
# Remove spurious toc entry from guide if it is not in spine or it
|
||||||
# does not have any hyperlinks
|
# 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:
|
if href in oeb.manifest.hrefs:
|
||||||
item = oeb.manifest.hrefs[href]
|
item = oeb.manifest.hrefs[href]
|
||||||
if (hasattr(item.data, 'xpath') and
|
if (hasattr(item.data, 'xpath') and
|
||||||
|
Loading…
x
Reference in New Issue
Block a user