Signed-off-by: Maksym Lysak <mly@zurich.ibm.com>
This commit is contained in:
Maksym Lysak 2024-11-12 09:51:48 +01:00
parent d8b4c07173
commit f7b58dfa51

View File

@ -213,16 +213,12 @@ class MsWordDocumentBackend(DeclarativeDocumentBackend):
return label, None return label, None
def handle_text_elements(self, element, docx_obj, doc): def handle_text_elements(self, element, docx_obj, doc):
# if hasattr(element, "text"):
# paragraph = element
# else:
paragraph = docx.text.paragraph.Paragraph(element, docx_obj) paragraph = docx.text.paragraph.Paragraph(element, docx_obj)
if paragraph.text is None: if paragraph.text is None:
# _log.warn(f"paragraph has text==None") # _log.warn(f"paragraph has text==None")
return return
text = paragraph.text.strip() text = paragraph.text.strip()
# if len(text)==0 # keep empty paragraphs, they seperate adjacent lists! # if len(text)==0 # keep empty paragraphs, they seperate adjacent lists!
# Common styles for bullet and numbered lists. # Common styles for bullet and numbered lists.