diff --git a/discord/ext/commands/converter.py b/discord/ext/commands/converter.py index 98d601fdc..600f4be92 100644 --- a/discord/ext/commands/converter.py +++ b/discord/ext/commands/converter.py @@ -473,16 +473,11 @@ class clean_content(Converter): result = pattern.sub(repl, argument) if self.escape_markdown: - transformations = { - re.escape(c): '\\' + c - for c in ('*', '`', '_', '~', '\\', '||') - } - - def replace(obj): - return transformations.get(re.escape(obj.group(0)), '') - - pattern = re.compile('|'.join(transformations.keys())) - result = pattern.sub(replace, result) + result = re.sub(r'\\', r'\\\\', result) + for c in ('*', '`', '_', '~', '|'): + regex = r'\{0}(?=([\s\S]*((?