aboutsummaryrefslogtreecommitdiff
path: root/mammoth
diff options
context:
space:
mode:
Diffstat (limited to 'mammoth')
-rw-r--r--mammoth/documents.py2
-rw-r--r--mammoth/docx/document_xml.py9
2 files changed, 11 insertions, 0 deletions
diff --git a/mammoth/documents.py b/mammoth/documents.py
index 9028b03..0e96c05 100644
--- a/mammoth/documents.py
+++ b/mammoth/documents.py
@@ -58,6 +58,8 @@ image = Image
def hyperlink(children, href=None, anchor=None):
return Hyperlink(href, anchor, children)
+
+bookmark = Bookmark = dodge.data_class("Bookmark", ["name"])
table = Table
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")