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

Compare commits

...

2 Commits

Author SHA1 Message Date
_run
e10517e088
Merge pull request #2017 from Artin-GH/patch-1
Fix backslash (\) issue in escape_markdown
2023-07-30 23:19:57 +05:00
Artin GH
1946393c36
Fix backslash (\) issue in escape_markdown 2023-07-14 16:39:50 +03:30

View File

@ -61,8 +61,8 @@ def escape_markdown(content: str) -> str:
:rtype: :obj:`str` :rtype: :obj:`str`
""" """
parse = re.sub(r"([_*\[\]()~`>\#\+\-=|\.!\{\}])", r"\\\1", content) parse = re.sub(r"([_*\[\]()~`>\#\+\-=|\.!\{\}\\])", r"\\\1", content)
reparse = re.sub(r"\\\\([_*\[\]()~`>\#\+\-=|\.!\{\}])", r"\1", parse) reparse = re.sub(r"\\\\([_*\[\]()~`>\#\+\-=|\.!\{\}\\])", r"\1", parse)
return reparse return reparse