From 9833ea82e247c0a01218d221293c9ed56b89d505 Mon Sep 17 00:00:00 2001 From: Rapptz Date: Sat, 6 Apr 2019 20:14:05 -0400 Subject: Add helpers to escape markdown and mentions from text. Fixes #1673 --- discord/utils.py | 40 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) (limited to 'discord/utils.py') diff --git a/discord/utils.py b/discord/utils.py index 96a26918..e277e56c 100644 --- a/discord/utils.py +++ b/discord/utils.py @@ -366,3 +366,43 @@ def resolve_invite(invite): return m.group(1) return invite +_MARKDOWN_ESCAPE_SUBREGEX = '|'.join(r'\{0}(?=([\s\S]*((?