Merge pull request #339 from metal0/fix-codeblocks-case-history

Fix codeblocks case history quote markdown
This commit is contained in:
Miikka 2022-08-13 23:31:21 +03:00 committed by GitHub
commit fdb81e37ed
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -1,4 +1,4 @@
import { MessageEditOptions, MessageOptions } from "discord.js"; import { MessageEditOptions, MessageOptions, Util } from "discord.js";
import { GuildPluginData } from "knub"; import { GuildPluginData } from "knub";
import moment from "moment-timezone"; import moment from "moment-timezone";
import { CaseTypes } from "../../../data/CaseTypes"; import { CaseTypes } from "../../../data/CaseTypes";
@ -67,7 +67,7 @@ export async function getCaseEmbed(
if (theCase.notes.length) { if (theCase.notes.length) {
for (const note of theCase.notes) { for (const note of theCase.notes) {
const noteDate = moment.utc(note.created_at); const noteDate = moment.utc(note.created_at);
let noteBody = note.body.trim(); let noteBody = Util.escapeCodeBlock(note.body.trim());
if (noteBody === "") { if (noteBody === "") {
noteBody = emptyEmbedValue; noteBody = emptyEmbedValue;
} }