except ValueError as e:
raise ValueError(repr(chunk.text)) from e
else:
+ previous_tail = previous.tail or ''
try:
- previous.tail = chunk.text
+ previous.tail = previous_tail + chunk.text
except ValueError as e:
raise ValueError(repr(chunk.text)) from e
elif isinstance(chunk, ControlCodeMatch):
body.append(pre)
tree = _etree.ElementTree(element=html)
html.text = html.tail = head.text = head.tail = '\n'
- body.text = body.tail = '\n'
+ body.text = body.tail = pre.tail = '\n'
return tree
def process(self, source, output=None):