mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04: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
@ -464,6 +464,10 @@ class Convert(object):
|
|||||||
for a, t in tuple(self.anchor_map.iteritems()):
|
for a, t in tuple(self.anchor_map.iteritems()):
|
||||||
if t == old_anchor:
|
if t == old_anchor:
|
||||||
self.anchor_map[a] = current_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)
|
m = re.match(r'heading\s+(\d+)$', style.style_name or '', re.IGNORECASE)
|
||||||
if m is not None:
|
if m is not None:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user