Discord code blocks can't have indentation
This commit is contained in:
parent
dc74d28b86
commit
e0e35058fd
1 changed files with 2 additions and 2 deletions
|
@ -78,8 +78,8 @@ const IGNORED_DISCORD_ERRORS = [
|
||||||
function toCodeBlock(s: string, indentation = 0, isDiscord = false) {
|
function toCodeBlock(s: string, indentation = 0, isDiscord = false) {
|
||||||
s = s.replace(/```/g, "`\u200B`\u200B`");
|
s = s.replace(/```/g, "`\u200B`\u200B`");
|
||||||
|
|
||||||
const indentationStr = Array(indentation).fill(" ").join("");
|
const indentationStr = Array(!isDiscord ? indentation : 0).fill(" ").join("");
|
||||||
return `\`\`\`\n${s.split("\n").map(s => indentationStr + s).join("\n")}\n${!isDiscord ? indentationStr : ""}\`\`\``;
|
return `\`\`\`\n${s.split("\n").map(s => indentationStr + s).join("\n")}\n${indentationStr}\`\`\``;
|
||||||
}
|
}
|
||||||
|
|
||||||
async function printReport() {
|
async function printReport() {
|
||||||
|
|
Loading…
Reference in a new issue