aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar MarkKoz <[email protected]>2020-06-12 15:32:25 -0700
committerGravatar MarkKoz <[email protected]>2020-06-12 15:32:25 -0700
commit46e770ba772e3c7048903efff41a5b969717e0d4 (patch)
treef8301e706c01984664574c4c6158410312eb6ac3
parentReplace mention of Flask with Django (diff)
Escape markdown in charinfo embed
The embed displays the original character. If it's a markdown char, it would interfere with the embed's actual markdown. The backtick was especially troublesome. Fixes #996
-rw-r--r--bot/cogs/utils.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/bot/cogs/utils.py b/bot/cogs/utils.py
index 73b4a1c0a..697bf60ce 100644
--- a/bot/cogs/utils.py
+++ b/bot/cogs/utils.py
@@ -6,7 +6,7 @@ from email.parser import HeaderParser
from io import StringIO
from typing import Tuple, Union
-from discord import Colour, Embed
+from discord import Colour, Embed, utils
from discord.ext.commands import BadArgument, Cog, Context, command
from bot.bot import Bot
@@ -145,7 +145,7 @@ class Utils(Cog):
u_code = f"\\U{digit:>08}"
url = f"https://www.compart.com/en/unicode/U+{digit:>04}"
name = f"[{unicodedata.name(char, '')}]({url})"
- info = f"`{u_code.ljust(10)}`: {name} - {char}"
+ info = f"`{u_code.ljust(10)}`: {name} - {utils.escape_markdown(char)}"
return info, u_code
charlist, rawlist = zip(*(get_info(c) for c in characters))