mirror of
https://github.com/kovidgoyal/calibre.git
synced 2026-04-02 23:31:59 -04:00
TXT Output: Fix asciiize option not applying to generated inline TOC
Fixes #3051
This commit is contained in:
parent
08801be3a9
commit
ee6e7d8d71
@ -97,7 +97,13 @@ class TXTMLizer:
|
||||
if getattr(self.opts, 'inline_toc', None):
|
||||
self.log.debug('Generating table of contents...')
|
||||
toc.append('{}\n\n'.format(_('Table of Contents:')))
|
||||
unihandecoder = None
|
||||
if getattr(self.opts, 'asciiize', False):
|
||||
from calibre.utils.localization import get_udc
|
||||
unihandecoder = get_udc()
|
||||
for item in self.toc_titles:
|
||||
if unihandecoder is not None:
|
||||
item = unihandecoder.decode(item)
|
||||
toc.append(f'* {item}\n\n')
|
||||
return ''.join(toc)
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user