fixed errors
This commit is contained in:
@@ -6,7 +6,7 @@ __date__ = "10.05.2022"
|
||||
__version__ = "1.0.0"
|
||||
__license__ = "None"
|
||||
|
||||
def contains_markdown_symbols(text):
|
||||
def contains_markdownv1_symbols(text):
|
||||
""" checks if text contains markdown symbols
|
||||
:type text: string
|
||||
|
||||
@@ -32,12 +32,30 @@ def make_markdown_proof(text): # used to avoid errors related to markdown parsem
|
||||
|
||||
:rtype: string
|
||||
"""
|
||||
if not contains_markdown_symbols(text):
|
||||
return text
|
||||
|
||||
text = text.replace("_", "\\_")
|
||||
text = text.replace("*", "\\*")
|
||||
text = text.replace("`", "\\`")
|
||||
text = text.replace("[", "\\[")
|
||||
text = text.replace("]", "\\]")
|
||||
text = text.replace("(", "\\(")
|
||||
text = text.replace(")", "\\)")
|
||||
text = text.replace("#", "\\#")
|
||||
text = text.replace("+", "\\+")
|
||||
text = text.replace("-", "\\-")
|
||||
text = text.replace("!", "\\!")
|
||||
text = text.replace(".", "\\.")
|
||||
text = text.replace("?", "\\?")
|
||||
text = text.replace("/", "\\/")
|
||||
text = text.replace("~", "\\~")
|
||||
text = text.replace("|", "\\|")
|
||||
text = text.replace("<", "\\<")
|
||||
text = text.replace(">", "\\>")
|
||||
text = text.replace("&", "\\&")
|
||||
text = text.replace("^", "\\^")
|
||||
text = text.replace("$", "\\$")
|
||||
text = text.replace("%", "\\%")
|
||||
|
||||
|
||||
return text
|
||||
|
||||
|
||||
Reference in New Issue
Block a user