mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
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:
parent
4b5f34a441
commit
396aa7f150
@ -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
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user