diff --git a/src/calibre/ebooks/oeb/base.py b/src/calibre/ebooks/oeb/base.py index 98f1be1068..e9f82715cb 100644 --- a/src/calibre/ebooks/oeb/base.py +++ b/src/calibre/ebooks/oeb/base.py @@ -785,10 +785,12 @@ class Manifest(object): data = first_pass(data) # Force into the XHTML namespace if barename(data.tag) != 'html': - data = first_pass(''+data+'') - if barename(data.tag) != 'html': - raise NotHTML( - 'File %r does not appear to be (X)HTML' % self.href) + self.log.warn('File %r does not appear to be (X)HTML'%self.href) + nroot = etree.fromstring('') + for child in list(data): + child.getparent.remove(child) + nroot.append(child) + data = nroot elif not namespace(data.tag): data.attrib['xmlns'] = XHTML_NS data = etree.tostring(data, encoding=unicode)