From 5d404dd5ab937bf2098b9a31d872ce5f1b086916 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Fri, 4 Mar 2016 20:01:32 +0530 Subject: [PATCH] DOCX Input: Ignore the hidden bookmark Word 2010 inserts to enable the go to last edit feature. Fixes #1552972 [DOCX Conversion - gitch](https://bugs.launchpad.net/calibre/+bug/1552972) --- src/calibre/ebooks/docx/to_html.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/calibre/ebooks/docx/to_html.py b/src/calibre/ebooks/docx/to_html.py index 25f9fd3be3..22186bdbb8 100644 --- a/src/calibre/ebooks/docx/to_html.py +++ b/src/calibre/ebooks/docx/to_html.py @@ -433,7 +433,9 @@ class Convert(object): self.layers[p].append(x) elif x.tag.endswith('}bookmarkStart'): anchor = self.namespace.get(x, 'w:name') - if anchor and anchor not in self.anchor_map: + if anchor and anchor not in self.anchor_map and anchor != '_GoBack': + # _GoBack is a special bookmark inserted by Word 2010 for + # the return to previous edit feature, we ignore it old_anchor = current_anchor self.anchor_map[anchor] = current_anchor = generate_anchor(anchor, frozenset(self.anchor_map.itervalues())) if old_anchor is not None: