diff options
Diffstat (limited to 'discord/ext/commands')
| -rw-r--r-- | discord/ext/commands/converter.py | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/discord/ext/commands/converter.py b/discord/ext/commands/converter.py index 8676329c..0ca9096b 100644 --- a/discord/ext/commands/converter.py +++ b/discord/ext/commands/converter.py @@ -474,14 +474,10 @@ class clean_content(Converter): result = pattern.sub(repl, argument) if self.escape_markdown: - result = re.sub(r'\\', r'\\\\', result) - for c in ('*', '`', '_', '~', '|'): - regex = r'\{0}(?=([\s\S]*((?<!\{0})\{0})))'.format(c) - replace = '\{0}'.format(c) - result = re.sub(regex, replace, result) + result = discord.utils.escape_markdown(result) # Completely ensure no mentions escape: - return re.sub(r'@(everyone|here|[!&]?[0-9]{17,21})', '@\u200b\\1', result) + return discord.utils.escape_mentions(result) class _Greedy: __slots__ = ('converter',) |