Skip to content

Commit bf844ed

Browse files
committed
HTML symbols not replaced
HTML symbols not replaced because return is before replace.
1 parent ad4be5c commit bf844ed

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

telebot/types.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -477,10 +477,10 @@ def func(text, type=None, url=None, user=None):
477477
url = "tg://user?id={0}".format(user.id)
478478
elif type == "mention":
479479
url = "https://t.me/{0}".format(text[1:])
480+
text = text.replace("&", "&amp;").replace("<", "&lt;").replace(">", "&gt;")
480481
if not type or not _subs.get(type):
481482
return text
482483
subs = _subs.get(type)
483-
text = text.replace("&", "&amp;").replace("<", "&lt;").replace(">", "&gt;")
484484
return subs.format(text=text, url=url)
485485

486486
offset = 0

0 commit comments

Comments
 (0)