Skip to content

Commit

Permalink
Fix single character alternation in regex
Browse files Browse the repository at this point in the history
  • Loading branch information
carolinaisslaying committed Mar 19, 2024
1 parent 4a52164 commit 04bdd27
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/Util/Function/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@ import { APIUser, OAuth2Scopes } from "discord.js";
import { createRequire } from "module";

export const escapeFormatting = (text: string) => {
const unescaped = text.replace(/\\(\*|_|`|~|\\)/g, "$1");
return unescaped.replace(/(\*|_|`|~|\\)/g, "\\$1");
const unescaped = text.replace(/\\([*_`~\\])/g, "$1");
return unescaped.replace(/([*_`~\\])/g, "\\$1");
};
const require = createRequire(import.meta.url);

Expand Down

0 comments on commit 04bdd27

Please sign in to comment.