From 9bfd99948361000c6432691c5b37c95127c53737 Mon Sep 17 00:00:00 2001 From: Michael Williamson Date: Sun, 1 Aug 2021 11:10:49 +0100 Subject: Convert tab elements to tab characters --- mammoth/raw_text.py | 2 ++ 1 file changed, 2 insertions(+) (limited to 'mammoth') 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): -- cgit v1.2.3