This commit is contained in:
Kovid Goyal 2014-01-27 20:20:55 +05:30
parent 67664e7956
commit d0cfb55682

View File

@ -376,10 +376,13 @@ class Convert(object):
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()
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: