CHM Input: Fix a regression in the previous release that broke conversion of CHM files. Fixes #2021413 [chm->pdf conversion german umlauts TOC problem](https://bugs.launchpad.net/calibre/+bug/2021413)

This commit is contained in:
Kovid Goyal 2023-05-29 19:36:51 +05:30
parent a4e68799ae
commit 1e16f53631
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C
2 changed files with 5 additions and 1 deletions

View File

@ -103,6 +103,7 @@ class CHMInput(InputFormatPlugin):
from calibre.customize.builtins import HTMLInput
opts.breadth_first = True
htmlinput = HTMLInput(None)
htmlinput.set_root_dir_of_input(basedir)
oeb = htmlinput.create_oebbook(htmlpath, basedir, opts, log, mi)
return oeb

View File

@ -76,6 +76,9 @@ class HTMLInput(InputFormatPlugin):
}
def set_root_dir_of_input(self, basedir):
self.root_dir_of_input = os.path.normcase(get_long_path_name(os.path.abspath(basedir)) + os.sep)
def convert(self, stream, opts, file_ext, log,
accelerators):
self._is_case_sensitive = None
@ -86,7 +89,7 @@ class HTMLInput(InputFormatPlugin):
if hasattr(stream, 'name'):
basedir = os.path.dirname(stream.name)
fname = os.path.basename(stream.name)
self.root_dir_of_input = os.path.normcase(get_long_path_name(os.path.abspath(basedir)) + os.sep)
self.set_root_dir_of_input(basedir)
if file_ext != 'opf':
if opts.dont_package: