diff --git a/src/calibre/ebooks/oeb/base.py b/src/calibre/ebooks/oeb/base.py index 17cbc9c947..2e6ba82cb9 100644 --- a/src/calibre/ebooks/oeb/base.py +++ b/src/calibre/ebooks/oeb/base.py @@ -850,6 +850,7 @@ class Manifest(object): return data def _parse_xhtml(self, data): + orig_data = data self.oeb.log.debug('Parsing', self.href, '...') # Convert to Unicode and normalize line endings data = self.oeb.decode(data) @@ -927,6 +928,8 @@ class Manifest(object): # Handle weird (non-HTML/fragment) files if barename(data.tag) != 'html': + if self.href.endswith('.ncx'): + return self._parse_xml(orig_data) self.oeb.log.warn('File %r does not appear to be (X)HTML'%self.href) nroot = etree.fromstring('') has_body = False