From ca03d35d85fff717941c6acb34155ae3d35ce04b Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Fri, 4 May 2012 08:32:41 +0530 Subject: [PATCH] ... --- src/calibre/ebooks/chm/reader.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/calibre/ebooks/chm/reader.py b/src/calibre/ebooks/chm/reader.py index 056b180fd3..28d7f1e7c7 100644 --- a/src/calibre/ebooks/chm/reader.py +++ b/src/calibre/ebooks/chm/reader.py @@ -156,7 +156,8 @@ class CHMReader(CHMFile): break if self.hhc_path not in files and files: for f in files: - if f.partition('.')[-1].lower() in {'html', 'htm'}: + if f.partition('.')[-1].lower() in {'html', 'htm', 'xhtm', + 'xhtml'}: self.hhc_path = f break @@ -168,6 +169,9 @@ class CHMReader(CHMFile): self.hhc_path = os.path.relpath(x, output_dir) break + if self.hhc_path not in files and files: + self.hhc_path = files[0] + def _reformat(self, data, htmlpath): if self.input_encoding: data = data.decode(self.input_encoding)