diff options
| author | Michael Williamson <mike@zwobble.org> | 2017-05-20 15:28:37 +0100 |
|---|---|---|
| committer | Michael Williamson <mike@zwobble.org> | 2017-05-20 15:28:37 +0100 |
| commit | 838736f4d74b43d59aa7bdc96830e0be7fd7f258 (patch) | |
| tree | a0045111040e75ea3977af3c02ce372e8202fbfe /mammoth/docx | |
| parent | d0b4eb76001049a23fe038025cfa56472703fa70 (diff) | |
Read whether row is header
Diffstat (limited to 'mammoth/docx')
| -rw-r--r-- | mammoth/docx/body_xml.py | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/mammoth/docx/body_xml.py b/mammoth/docx/body_xml.py index cc4e98f..49ff431 100644 --- a/mammoth/docx/body_xml.py +++ b/mammoth/docx/body_xml.py @@ -62,6 +62,7 @@ def _create_reader(numbering, content_types, relationships, styles, docx_file, f "w:rPr", "w:tblPr", "w:tblGrid", + "w:trPr", "w:tcPr", ]) @@ -208,8 +209,13 @@ def _create_reader(numbering, content_types, relationships, styles, docx_file, f def table_row(element): + properties = element.find_child_or_null("w:trPr") + is_header = bool(properties.find_child("w:tblHeader")) return _read_xml_elements(element.children) \ - .map(documents.table_row) + .map(lambda children: documents.table_row( + children=children, + is_header=is_header, + )) def table_cell(element): |
