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
1 changed files with 11 additions and 1 deletions

View File

@ -198,4 +198,14 @@ def hpre(content: str, escape: bool=True, language: str="") -> str:
:param content: The string to preformatted.
: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>'