mirror of
git://github.com/kovidgoyal/calibre.git
synced 2026-05-09 08:43:10 +02:00
...
This commit is contained in:
parent
67664e7956
commit
d0cfb55682
1 changed files with 6 additions and 3 deletions
|
|
@ -376,10 +376,13 @@ def convert_p(self, p):
|
|||
def p_parent(x):
|
||||
# Ensure that nested <w:p> tags are handled. These can occur if a
|
||||
# textbox is present inside a paragraph.
|
||||
while x is not None:
|
||||
while True:
|
||||
x = x.getparent()
|
||||
if x.tag.endswith('}p'):
|
||||
return x
|
||||
try:
|
||||
if x.tag.endswith('}p'):
|
||||
return x
|
||||
except AttributeError:
|
||||
break
|
||||
|
||||
for x in descendants(p, 'w:r', 'w:bookmarkStart', 'w:hyperlink'):
|
||||
if p_parent(x) is not p:
|
||||
|
|
|
|||
Loading…
Reference in a new issue