mirror of
git://github.com/kovidgoyal/calibre.git
synced 2026-01-04 00:25:13 +01:00
OEBBook: remove invalid links.
This commit is contained in:
parent
32192a5a72
commit
1a01daab1b
1 changed files with 6 additions and 0 deletions
|
|
@ -904,6 +904,12 @@ def first_pass(data):
|
|||
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('<a[^/]*?/>', '', data)
|
||||
data = etree.fromstring(data)
|
||||
|
||||
return data
|
||||
|
||||
def _parse_txt(self, data):
|
||||
|
|
|
|||
Loading…
Reference in a new issue