mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
...
This commit is contained in:
parent
67664e7956
commit
d0cfb55682
@ -376,10 +376,13 @@ class Convert(object):
|
|||||||
def p_parent(x):
|
def p_parent(x):
|
||||||
# Ensure that nested <w:p> tags are handled. These can occur if a
|
# Ensure that nested <w:p> tags are handled. These can occur if a
|
||||||
# textbox is present inside a paragraph.
|
# textbox is present inside a paragraph.
|
||||||
while x is not None:
|
while True:
|
||||||
x = x.getparent()
|
x = x.getparent()
|
||||||
if x.tag.endswith('}p'):
|
try:
|
||||||
return x
|
if x.tag.endswith('}p'):
|
||||||
|
return x
|
||||||
|
except AttributeError:
|
||||||
|
break
|
||||||
|
|
||||||
for x in descendants(p, 'w:r', 'w:bookmarkStart', 'w:hyperlink'):
|
for x in descendants(p, 'w:r', 'w:bookmarkStart', 'w:hyperlink'):
|
||||||
if p_parent(x) is not p:
|
if p_parent(x) is not p:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user