chunks[i] = str(chunk, self._encoding)
return chunks
+ def _replace_tabs(self, chunks):
+ for i,chunk in enumerate(chunks):
+ if (isinstance(chunks[i], ControlCodeMatch) and
+ chunks[i].control_code.name == 'horizontal tab'):
+ chunks[i] = '\t'
+ return chunks
+
def _merge_adjacent_text(self, chunks):
i = 1
while i < len(chunks):
def parse(self, element, text):
chunks = self._replace_control_codes(text)
chunks = self._decode_text(chunks)
+ chunks = self._replace_tabs(chunks)
chunks = self._merge_adjacent_text(chunks)
chunks = self._remove_operating_system_commands(chunks)
chunks = self._merge_adjacent_text(chunks)