From d854babf2277161404e55d3e0eb465ae81bc14ef Mon Sep 17 00:00:00 2001 From: Lonami Exo Date: Mon, 19 Nov 2018 09:20:13 +0100 Subject: [PATCH] Make HTML parser yield the correct offset and lengths --- telethon/extensions/html.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/telethon/extensions/html.py b/telethon/extensions/html.py index 8a397336..73c0ba38 100644 --- a/telethon/extensions/html.py +++ b/telethon/extensions/html.py @@ -98,7 +98,7 @@ class HTMLToTelegramParser(HTMLParser): text = url for tag, entity in self._building_entities.items(): - entity.length += len(text.strip('\n')) + entity.length += len(text) self.text += text