mirror of
git://github.com/kovidgoyal/calibre.git
synced 2026-03-04 15:34:41 +01:00
DOCX Input: Fix links that point to anchors placed in empty paragraphs not working. Fixes #1683017 [Bookmarks on graphics or empty paragraphs break Table of Contents](https://bugs.launchpad.net/calibre/+bug/1683017)
This commit is contained in:
parent
c6d46ceffa
commit
40b51ee2f4
1 changed files with 4 additions and 0 deletions
|
|
@ -464,6 +464,10 @@ def p_parent(x):
|
|||
for a, t in tuple(self.anchor_map.iteritems()):
|
||||
if t == old_anchor:
|
||||
self.anchor_map[a] = current_anchor
|
||||
if current_anchor is not None:
|
||||
# This paragraph had no <w:r> descendants
|
||||
dest.set('id', current_anchor)
|
||||
current_anchor = None
|
||||
|
||||
m = re.match(r'heading\s+(\d+)$', style.style_name or '', re.IGNORECASE)
|
||||
if m is not None:
|
||||
|
|
|
|||
Loading…
Reference in a new issue