diff --git a/src/calibre/ebooks/oeb/base.py b/src/calibre/ebooks/oeb/base.py index 8941f97304..23b01da1a2 100644 --- a/src/calibre/ebooks/oeb/base.py +++ b/src/calibre/ebooks/oeb/base.py @@ -904,6 +904,12 @@ class Manifest(object): if key == 'lang' or key.endswith('}lang'): body.attrib.pop(key) + # Remove invalid links as they casue overflow until the next link + # in rendering. + data = etree.tostring(data) + data = re.sub('', '', data) + data = etree.fromstring(data) + return data def _parse_txt(self, data):