From e135a91d3c76eb29a274a2f608b41787bf49e5ee Mon Sep 17 00:00:00 2001 From: Michael Williamson Date: Wed, 15 Jul 2015 16:23:27 +0100 Subject: Fix: cannot extract text from elements without children --- mammoth/raw_text.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'mammoth') diff --git a/mammoth/raw_text.py b/mammoth/raw_text.py index fb39acf..ccf50ed 100644 --- a/mammoth/raw_text.py +++ b/mammoth/raw_text.py @@ -5,7 +5,7 @@ def extract_raw_text_from_element(element): if isinstance(element, documents.Text): return element.value else: - text = "".join(map(extract_raw_text_from_element, element.children)) + text = "".join(map(extract_raw_text_from_element, getattr(element, "children", []))) if isinstance(element, documents.Paragraph): return text + "\n\n" else: -- cgit v1.2.3