mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
DOCX: Fix incorrect styling of hyperlinks
The <w:r> tags for hyperlinks are not children of <w:p>, use the ancestor axis instead of getparent().
This commit is contained in:
parent
6fd3d84f3b
commit
02a28056de
@ -265,7 +265,8 @@ class Styles(object):
|
|||||||
def resolve_run(self, r):
|
def resolve_run(self, r):
|
||||||
ans = self.run_cache.get(r, None)
|
ans = self.run_cache.get(r, None)
|
||||||
if ans is None:
|
if ans is None:
|
||||||
p = r.getparent()
|
p = XPath('ancestor::w:p[1]')(r)
|
||||||
|
p = p[0] if p else None
|
||||||
ans = self.run_cache[r] = RunStyle()
|
ans = self.run_cache[r] = RunStyle()
|
||||||
direct_formatting = None
|
direct_formatting = None
|
||||||
for rPr in XPath('./w:rPr')(r):
|
for rPr in XPath('./w:rPr')(r):
|
||||||
|
Loading…
x
Reference in New Issue
Block a user