diff options
| author | Michael Williamson <mike@zwobble.org> | 2015-02-11 20:27:25 +0000 |
|---|---|---|
| committer | Michael Williamson <mike@zwobble.org> | 2015-02-11 20:27:25 +0000 |
| commit | 519dfddb18eea15c26d0d8d8da68e1cebd865c39 (patch) | |
| tree | fbe04f78b24c604463191a3f497eab403e73edda /mammoth/docx | |
| parent | 7ba9cc0ecdca695fec3cb90c98dd383e0edb2ba9 (diff) | |
Read bookmarks
Diffstat (limited to 'mammoth/docx')
| -rw-r--r-- | mammoth/docx/document_xml.py | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/mammoth/docx/document_xml.py b/mammoth/docx/document_xml.py index 56298f3..8bfdd6f 100644 --- a/mammoth/docx/document_xml.py +++ b/mammoth/docx/document_xml.py @@ -186,6 +186,15 @@ def _create_reader(numbering, content_types, relationships, styles, note_element else: return children_result + @handler("w:bookmarkStart") + def bookmark_start(element): + name = element.attributes.get("w:name") + if name == "_GoBack": + return results.success(None) + else: + return results.success(documents.bookmark(name)) + + @handler("w:br") def br(element): break_type = element.attributes.get("w:type") |
