it worked for me

This commit is contained in:
thororen1234 2025-12-10 11:13:34 -05:00
parent b341fa70c6
commit 9d2f3c84b1
No known key found for this signature in database

View file

@ -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");