From 9f817d6042e6913cb2e4f30a0989c353e04cc865 Mon Sep 17 00:00:00 2001 From: kthoden Date: Tue, 30 Jul 2019 16:10:14 +0200 Subject: [PATCH] Get plain text from paragraphs --- imxml2django.py | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/imxml2django.py b/imxml2django.py index 06fb358..49ec48c 100755 --- a/imxml2django.py +++ b/imxml2django.py @@ -817,10 +817,7 @@ def djangoParseObject(xmlElement, indent=False, listtype=None, listnumber=0, uid xmlResult = etree.Element("temp") else: xmlElement.tag = "EOAparagraph" - if xmlElement.text: - logging.debug(f"The beginning of this paragraph is: '{xmlElement.text[:40]}…'") - else: - logging.debug(f"This is a paragraph without text.") + logging.debug(f"The beginning of this paragraph is: '{libeoaconvert.gettext(xmlElement)[:40]}…'") quoted_paragraph = xmlElement.get("rend") if quoted_paragraph is not None and quoted_paragraph == "quoted": xmlElement.set("rend", "quoted")