mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-07 10:14:46 -04:00
Book polishing: Do not error out when polishing epub files that have XML comments in their OPF metadata section.
This commit is contained in:
parent
ebf4068ebc
commit
ac5d96f7f3
@ -391,9 +391,12 @@ class Container(object):
|
||||
remove = set()
|
||||
for child in mdata:
|
||||
child.tail = '\n '
|
||||
if (child.get('name', '').startswith('calibre:') and
|
||||
child.get('content', '').strip() in {'{}', ''}):
|
||||
remove.add(child)
|
||||
try:
|
||||
if (child.get('name', '').startswith('calibre:') and
|
||||
child.get('content', '').strip() in {'{}', ''}):
|
||||
remove.add(child)
|
||||
except AttributeError:
|
||||
continue # Happens for XML comments
|
||||
for child in remove: mdata.remove(child)
|
||||
if len(mdata) > 0:
|
||||
mdata[-1].tail = '\n '
|
||||
|
Loading…
x
Reference in New Issue
Block a user