diff --git a/docling/backend/msword_backend.py b/docling/backend/msword_backend.py index 2291fcf2..bb90d147 100644 --- a/docling/backend/msword_backend.py +++ b/docling/backend/msword_backend.py @@ -304,7 +304,7 @@ class MsWordDocumentBackend(DeclarativeDocumentBackend): # If the style changes for a non empty text, add the previous group if len(group_text.strip()) > 0: - paragraph_elements.append((group_text, previous_format, None)) + paragraph_elements.append((group_text.strip(), previous_format, None)) group_text = "" # If there is a hyperlink, add it immediately