From 1a01daab1b4a61e903cf6ddee272603d039f499f Mon Sep 17 00:00:00 2001 From: John Schember Date: Fri, 31 Jul 2009 08:29:05 -0400 Subject: [PATCH] OEBBook: remove invalid links. --- src/calibre/ebooks/oeb/base.py | 6 ++++++ 1 file changed, 6 insertions(+) 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):