From d6873b7159352479475b3a0daa215bddbdd3a79b Mon Sep 17 00:00:00 2001 From: RedGuy12 <61329810+RedGuy12@users.noreply.github.com> Date: Sat, 19 Nov 2022 15:08:33 -0600 Subject: [PATCH] fix(escapeMarkdown): fix double escaping (#8798) * fix(escapeMarkdown): fix double escaping Signed-off-by: RedGuy12 <61329810+RedGuy12@users.noreply.github.com> * remove cruft Signed-off-by: RedGuy12 <61329810+RedGuy12@users.noreply.github.com> Signed-off-by: RedGuy12 <61329810+RedGuy12@users.noreply.github.com> Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com> --- packages/discord.js/src/util/Util.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/discord.js/src/util/Util.js b/packages/discord.js/src/util/Util.js index dc722e13f636..44c0e1e6a4b6 100644 --- a/packages/discord.js/src/util/Util.js +++ b/packages/discord.js/src/util/Util.js @@ -140,6 +140,7 @@ function escapeMarkdown( }) .join(inlineCode ? '\\`' : '`'); } + if (escape) text = escapeEscape(text); if (inlineCode) text = escapeInlineCode(text); if (codeBlock) text = escapeCodeBlock(text); if (italic) text = escapeItalic(text); @@ -147,7 +148,6 @@ function escapeMarkdown( if (underline) text = escapeUnderline(text); if (strikethrough) text = escapeStrikethrough(text); if (spoiler) text = escapeSpoiler(text); - if (escape) text = escapeEscape(text); if (heading) text = escapeHeading(text); if (bulletedList) text = escapeBulletedList(text); if (numberedList) text = escapeNumberedList(text);