mirror of
				https://github.com/kovidgoyal/calibre.git
				synced 2025-11-03 19:17:02 -05:00 
			
		
		
		
	Fix #3057 (Viewer Cuts Off MOBI File)
This commit is contained in:
		
							parent
							
								
									8279c02ec6
								
							
						
					
					
						commit
						4fedde3f21
					
				@ -305,6 +305,8 @@ class MobiReader(object):
 | 
			
		||||
        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…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user