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

Added ability to hide a link in text

This commit is contained in:
coder2020official 2022-05-21 17:39:45 +05:00
parent 0f44fd3c40
commit 5e3fd17436

View File

@ -198,4 +198,14 @@ def hpre(content: str, escape: bool=True, language: str="") -> str:
:param content: The string to preformatted. :param content: The string to preformatted.
:param escape: True if you need to escape special characters. :param escape: True if you need to escape special characters.
""" """
return '<pre><code class="{}">{}</code></pre>'.format(language, escape_html(content) if escape else content) return '<pre><code class="{}">{}</code></pre>'.format(language, escape_html(content) if escape else content)
def hide_link(url: str) -> str:
"""
Hide url of an image.
:param url:
:return: str
"""
return f'<a href="{url}">&#8288;</a>'