Edit book: Handle epub files which contain opf files with no <metadata> tags

This commit is contained in:
Kovid Goyal 2013-12-20 23:31:53 +05:30
parent 512d608a95
commit 72d2a7e372

View File

@ -692,7 +692,11 @@ class Container(object): # {{{
return item
def format_opf(self):
try:
mdata = self.opf_xpath('//opf:metadata')[0]
except IndexError:
pass
else:
mdata.text = '\n '
remove = set()
for child in mdata: