it worked for me
This commit is contained in:
parent
b341fa70c6
commit
9d2f3c84b1
1 changed files with 4 additions and 0 deletions
|
|
@ -87,6 +87,10 @@ const IGNORED_DISCORD_ERRORS = [
|
|||
function toCodeBlock(s: string, indentation = 0, isDiscord = false) {
|
||||
s = s.replace(/```/g, "`\u200B`\u200B`");
|
||||
|
||||
s = s.replace(/\\x([0-9A-Fa-f]{2})/g, (_, hex) =>
|
||||
String.fromCharCode(parseInt(hex, 16))
|
||||
);
|
||||
|
||||
const indentationStr = " ".repeat(!isDiscord ? indentation : 0);
|
||||
const content = s.split("\n").map(s => indentationStr + s).join("\n");
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue