Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

escapeMarkdown does not escape backslashes #8689

Closed
GrantGryczan opened this issue Sep 30, 2022 · 0 comments · Fixed by #8701
Closed

escapeMarkdown does not escape backslashes #8689

GrantGryczan opened this issue Sep 30, 2022 · 0 comments · Fixed by #8701

Comments

@GrantGryczan
Copy link

GrantGryczan commented Sep 30, 2022

Which package is this bug report for?

discord.js

Issue description

I wasn't sure if this counts as a bug or a feature suggestion, but I expected escapeMarkdown to also escape the \ character, and it does not, leaving me to have to write .replace(/\\/g, '\\\\') everywhere I call escapeMarkdown (or a function of my own that does the same).

There should perhaps also be a separate function for only escaping backslashes, like escapeEscapes.

Code sample

const { escapeMarkdown } = require('discord.js');

console.log(escapeMarkdown('\\')); // Outputs '\\' instead of '\\\\'

Package version

14.5.0

Node.js version

16.13.2

Operating system

Windows

Priority this issue should have

Low (slightly annoying)

Which partials do you have configured?

No Partials

Which gateway intents are you subscribing to?

No Intents

I have tested this issue on a development release

No response

@kodiakhq kodiakhq bot closed this as completed in #8701 Oct 10, 2022
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Oct 10, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants