mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-11 00:53:31 +01:00
fix(util): allow escapeInlineCode to escape double backtics (#7638)
* fix(util): allow scapeInlineCode to escape double backtics * fix: replace backtics properly * chore: fix lint
This commit is contained in:
@@ -189,7 +189,7 @@ class Util extends null {
|
||||
* @returns {string}
|
||||
*/
|
||||
static escapeInlineCode(text) {
|
||||
return text.replaceAll('`', '\\`');
|
||||
return text.replace(/(?<=^|[^`])``?(?=[^`]|$)/g, match => (match.length === 2 ? '\\`\\`' : '\\`'));
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user