DOCX Input: Dont error out when the input document contains a hyperlink that spans multiple paragraphs. Fixes #1474499 [Private bug](https://bugs.launchpad.net/calibre/+bug/1474499)

This commit is contained in:
Kovid Goyal 2015-07-17 21:47:11 +05:30
parent 4b5f34a441
commit 396aa7f150

View File

@ -493,7 +493,13 @@ class Convert(object):
wrapper.tail = elems[-1].tail wrapper.tail = elems[-1].tail
elems[-1].tail = None elems[-1].tail = None
for elem in elems: for elem in elems:
p.remove(elem) try:
p.remove(elem)
except ValueError:
# Probably a hyperlink that spans multiple
# paragraphs,theoretically we should break this up into
# multiple hyperlinks, but I can't be bothered.
elem.getparent().remove(elem)
wrapper.append(elem) wrapper.append(elem)
return wrapper return wrapper