Revert "Enhance Parser when dealing with leading and trailing whitespaces"

This reverts commit 8cdcf90b
This commit is contained in:
Dan 2019-09-07 12:49:35 +02:00
parent 3f4441d0f5
commit f3b33ef1d5

View File

@ -86,8 +86,7 @@ class Parser(HTMLParser):
for entities in self.tag_entities.values():
for entity in entities:
entity.offset += len(data) - len(data.lstrip()) # Ignore left whitespaces for offsets
entity.length += len(data.strip()) # Ignore all whitespaces (left + right) for lengths
entity.length += len(data)
self.text += data