diff options
| -rw-r--r-- | mammoth/conversion.py | 2 | ||||
| -rw-r--r-- | tests/conversion_tests.py | 11 |
2 files changed, 12 insertions, 1 deletions
diff --git a/mammoth/conversion.py b/mammoth/conversion.py index e21e3a0..b324c16 100644 --- a/mammoth/conversion.py +++ b/mammoth/conversion.py @@ -94,7 +94,7 @@ class DocumentConverter(object): def _find_html_path_for_paragraph(self, paragraph): - default = html_paths.path([html_paths.element("p")]) + default = html_paths.path([html_paths.element("p", fresh=True)]) return self._find_html_path(paragraph, "paragraph", default) def _find_html_path_for_run(self, run): diff --git a/tests/conversion_tests.py b/tests/conversion_tests.py index a041561..e3b4c9e 100644 --- a/tests/conversion_tests.py +++ b/tests/conversion_tests.py @@ -16,6 +16,17 @@ def plain_paragraph_is_converted_to_plain_paragraph(): @istest +def multiple_paragraphs_are_converted_to_multiple_paragraphs(): + result = convert_document_element_to_html( + documents.document([ + documents.paragraph(children=[_run_with_text("Hello")]), + documents.paragraph(children=[_run_with_text("there")]), + ]) + ) + assert_equal('<p>Hello</p><p>there</p>', result.value) + + +@istest def empty_paragraphs_are_ignored(): result = convert_document_element_to_html( documents.paragraph(children=[_run_with_text("")]) |
