aboutsummaryrefslogtreecommitdiff
path: root/mammoth
diff options
context:
space:
mode:
authorMichael Williamson <mike@zwobble.org>2021-08-01 11:10:49 +0100
committerMichael Williamson <mike@zwobble.org>2021-08-01 11:10:49 +0100
commit9bfd99948361000c6432691c5b37c95127c53737 (patch)
treeb0db98a7fda5b4a5d9f782a81be527493ad891f6 /mammoth
parent822cc689ce44b1c43ac118b2a13c6d0024d2e194 (diff)
Convert tab elements to tab characters
Diffstat (limited to 'mammoth')
-rw-r--r--mammoth/raw_text.py2
1 files changed, 2 insertions, 0 deletions
diff --git a/mammoth/raw_text.py b/mammoth/raw_text.py
index ccf50ed..5ffe59f 100644
--- a/mammoth/raw_text.py
+++ b/mammoth/raw_text.py
@@ -4,6 +4,8 @@ from . import documents
def extract_raw_text_from_element(element):
if isinstance(element, documents.Text):
return element.value
+ elif isinstance(element, documents.Tab):
+ return "\t"
else:
text = "".join(map(extract_raw_text_from_element, getattr(element, "children", [])))
if isinstance(element, documents.Paragraph):