From bf844ed2026ee9334d33e32331f120b79ed1e7e8 Mon Sep 17 00:00:00 2001 From: Badiboy Date: Wed, 1 Jan 2020 13:46:18 +0300 Subject: [PATCH] HTML symbols not replaced HTML symbols not replaced because return is before replace. --- telebot/types.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/telebot/types.py b/telebot/types.py index 6165c94..d8fe236 100644 --- a/telebot/types.py +++ b/telebot/types.py @@ -477,10 +477,10 @@ class Message(JsonDeserializable): url = "tg://user?id={0}".format(user.id) elif type == "mention": url = "https://t.me/{0}".format(text[1:]) + text = text.replace("&", "&").replace("<", "<").replace(">", ">") if not type or not _subs.get(type): return text subs = _subs.get(type) - text = text.replace("&", "&").replace("<", "<").replace(">", ">") return subs.format(text=text, url=url) offset = 0