1
0
mirror of https://github.com/eternnoir/pyTelegramBotAPI.git synced 2023-08-10 21:12:57 +03:00

Update util.py

This commit is contained in:
reddere 2022-12-03 14:23:10 +01:00 committed by GitHub
parent ae20cb9f31
commit 4ed460b137
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -401,8 +401,9 @@ def escape(text: str) -> str:
chars = {"&": "&amp;", "<": "&lt;", ">": "&gt;"} chars = {"&": "&amp;", "<": "&lt;", ">": "&gt;"}
if text is None: if text is None:
return None return None
for old, new in chars.items(): text = text.replace(old, new) for old, new in chars.items():
return text text = text.replace(old, new)
return text
def user_link(user: types.User, include_id: bool=False) -> str: def user_link(user: types.User, include_id: bool=False) -> str: