mirror of
git://github.com/kovidgoyal/calibre.git
synced 2025-12-21 21:04:27 +01:00
Fix #3057 (Viewer Cuts Off MOBI File)
This commit is contained in:
parent
8279c02ec6
commit
4fedde3f21
1 changed files with 2 additions and 0 deletions
|
|
@ -305,6 +305,8 @@ def extract_content(self, output_dir, parse_cache):
|
|||
self.log.debug('Parsing HTML...')
|
||||
try:
|
||||
root = html.fromstring(self.processed_html)
|
||||
if len(root.xpath('//html')) > 5:
|
||||
root = html.fromstring(self.processed_html.replace('\x0c', ''))
|
||||
except:
|
||||
self.log.warning('MOBI markup appears to contain random bytes. Stripping.')
|
||||
self.processed_html = self.remove_random_bytes(self.processed_html)
|
||||
|
|
|
|||
Loading…
Reference in a new issue