Fix #3451 (converting a PRC to EPUB creates a shortened epub file)

This commit is contained in:
Kovid Goyal 2009-09-10 17:55:20 -06:00
parent 39fc7f0cf6
commit 4bdd6e6011

View File

@ -309,7 +309,8 @@ class MobiReader(object):
try:
root = html.fromstring(self.processed_html)
if len(root.xpath('//html')) > 5:
root = html.fromstring(self.processed_html.replace('\x0c', ''))
root = html.fromstring(self.processed_html.replace('\x0c',
'').replace('\x14', ''))
except:
self.log.warning('MOBI markup appears to contain random bytes. Stripping.')
self.processed_html = self.remove_random_bytes(self.processed_html)