mirror of
git://github.com/kovidgoyal/calibre.git
synced 2026-04-22 00:33:14 +02:00
html2lrf shouldn't die on empty HTML files.
This commit is contained in:
parent
0d86fc0cf2
commit
0603501067
1 changed files with 7 additions and 1 deletions
|
|
@ -517,7 +517,13 @@ def get_valid_block(page):
|
|||
return c
|
||||
raise ConversionError(_('Could not parse file: %s')%self.file_name)
|
||||
else:
|
||||
index = self.book.pages().index(opage)
|
||||
try:
|
||||
index = self.book.pages().index(opage)
|
||||
except ValueError:
|
||||
self.log_warning(_('%s is an empty file')%self.file_name)
|
||||
tb = self.book.create_text_block()
|
||||
self.current_page.append(tb)
|
||||
return tb
|
||||
for page in list(self.book.pages()[index+1:]):
|
||||
for c in page.contents:
|
||||
if isinstance(c, (TextBlock, ImageBlock)):
|
||||
|
|
|
|||
Loading…
Reference in a new issue