This commit is contained in:
Kovid Goyal 2016-10-01 22:25:32 +05:30
parent 231b0e45f9
commit 18c98916b4

View File

@ -44,7 +44,7 @@ def find_previous_calibre_inline_toc(oeb):
class TOCAdder(object):
def __init__(self, oeb, opts, replace_previous_inline_toc=False, ignore_existing_toc=False):
def __init__(self, oeb, opts, replace_previous_inline_toc=True, ignore_existing_toc=False):
self.oeb, self.opts, self.log = oeb, opts, oeb.log
self.title = opts.toc_title or DEFAULT_TITLE
self.at_start = opts.mobi_toc_at_start
@ -53,7 +53,7 @@ class TOCAdder(object):
self.has_toc = oeb.toc and oeb.toc.count() > 1
self.tocitem = tocitem = None
if find_previous_calibre_inline_toc:
if replace_previous_inline_toc:
tocitem = self.tocitem = find_previous_calibre_inline_toc(oeb)
if ignore_existing_toc and 'toc' in oeb.guide:
oeb.guide.remove('toc')