diff options
| author | Michael Williamson <mike@zwobble.org> | 2013-12-14 16:19:06 +0000 |
|---|---|---|
| committer | Michael Williamson <mike@zwobble.org> | 2013-12-14 16:19:06 +0000 |
| commit | 07480fc677e51edc2af85a5c6ed9fd9449a7dac6 (patch) | |
| tree | 16006f130ad86e797975c2c2f3fd20f475cbeae9 /mammoth/conversion.py | |
| parent | 94638afbc228c9005e302ab6bc3d16c4e3e32b1d (diff) | |
Support matching of paragraph matcher with no style
Diffstat (limited to 'mammoth/conversion.py')
| -rw-r--r-- | mammoth/conversion.py | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/mammoth/conversion.py b/mammoth/conversion.py index 4a4cf99..624f6cb 100644 --- a/mammoth/conversion.py +++ b/mammoth/conversion.py @@ -53,7 +53,9 @@ class DocumentConverter(object): def _find_html_path_for_paragraph(self, paragraph): for style in self._styles: document_matcher = style.document_matcher - if document_matcher.element_type == "paragraph" and document_matcher.style_name == paragraph.style_name: + if document_matcher.element_type == "paragraph" and ( + document_matcher.style_name is None or + document_matcher.style_name == paragraph.style_name): return style.html_path return html_paths.path([html_paths.element("p")]) |
