diff options
| author | Michael Williamson <mike@zwobble.org> | 2017-05-24 23:05:13 +0100 |
|---|---|---|
| committer | Michael Williamson <mike@zwobble.org> | 2017-05-24 23:05:13 +0100 |
| commit | 803e22c8b95faa99aad82a4c9a30aa132f123416 (patch) | |
| tree | 4c6cd38d06a9878912108570a313002b5136c31e /mammoth/conversion.py | |
| parent | b85162078e74dd3f523ce01c96ed2d27e1cda118 (diff) | |
Handle unexpected children in table
Diffstat (limited to 'mammoth/conversion.py')
| -rw-r--r-- | mammoth/conversion.py | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/mammoth/conversion.py b/mammoth/conversion.py index cbe207a..eb09ded 100644 --- a/mammoth/conversion.py +++ b/mammoth/conversion.py @@ -166,7 +166,10 @@ class _DocumentConverter(documents.element_visitor(args=1)): def visit_table(self, table, context): - body_index = find_index(lambda child: not child.is_header, table.children) + body_index = find_index( + lambda child: not isinstance(child, documents.TableRow) or not child.is_header, + table.children, + ) if body_index is None: body_index = len(table.children) |
