From a86b2ae881b72bc7495bc5a4e4c2eef3973a1235 Mon Sep 17 00:00:00 2001 From: RedGuy12 <61329810+RedGuy12@users.noreply.github.com> Date: Sun, 30 Oct 2022 16:14:24 -0500 Subject: [PATCH 1/2] fix(escapeMarkdown): fix double escaping Signed-off-by: RedGuy12 <61329810+RedGuy12@users.noreply.github.com> --- packages/discord.js/src/util/Util.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/packages/discord.js/src/util/Util.js b/packages/discord.js/src/util/Util.js index dc722e13f636..768e4685068d 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); @@ -155,6 +155,8 @@ function escapeMarkdown( return text; } + +console.log(escapeMarkdown("_")) /** * Escapes code block markdown in a string. * @param {string} text Content to escape From f5d40702681af8508a7a552be36e2c8d7dc0a216 Mon Sep 17 00:00:00 2001 From: RedGuy12 <61329810+RedGuy12@users.noreply.github.com> Date: Sun, 30 Oct 2022 16:24:20 -0500 Subject: [PATCH 2/2] remove cruft Signed-off-by: RedGuy12 <61329810+RedGuy12@users.noreply.github.com> --- packages/discord.js/src/util/Util.js | 2 -- 1 file changed, 2 deletions(-) diff --git a/packages/discord.js/src/util/Util.js b/packages/discord.js/src/util/Util.js index 768e4685068d..44c0e1e6a4b6 100644 --- a/packages/discord.js/src/util/Util.js +++ b/packages/discord.js/src/util/Util.js @@ -155,8 +155,6 @@ function escapeMarkdown( return text; } - -console.log(escapeMarkdown("_")) /** * Escapes code block markdown in a string. * @param {string} text Content to escape