diff options
| author | Michael Williamson <mike@zwobble.org> | 2014-08-05 16:36:15 +0100 |
|---|---|---|
| committer | Michael Williamson <mike@zwobble.org> | 2014-08-05 16:36:15 +0100 |
| commit | ef76dd48d78fc715ce428e07cec2401b3bfbee74 (patch) | |
| tree | c5d673054c3e6be30430ba72dfa5a64499f21c5f /mammoth/docx/document_xml.py | |
| parent | 5b82690434d0cbccfe7d58b4ba00a402c83087b3 (diff) | |
Add support for reading w:br
Diffstat (limited to 'mammoth/docx/document_xml.py')
| -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 32d655c..f96098e 100644 --- a/mammoth/docx/document_xml.py +++ b/mammoth/docx/document_xml.py @@ -159,6 +159,15 @@ def _create_reader(numbering, content_types, relationships, styles, docx_file): href = relationships[relationship_id].target return children_result.map(lambda children: documents.hyperlink(href, children)) + @handler("w:br") + def br(element): + break_type = element.attributes.get("w:type") + if break_type: + warning = results.warning("Unsupported break type: {0}".format(break_type)) + return results.Result(None, [warning]) + else: + return results.success(documents.line_break()) + @handler("wp:inline") @handler("wp:anchor") def inline(element): |
