mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
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:
parent
a4e68799ae
commit
1e16f53631
@ -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
|
||||
|
||||
|
@ -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:
|
||||
|
Loading…
x
Reference in New Issue
Block a user