From 0bc19cf226c0b5ed31af0fd40b853ce3b2e56e83 Mon Sep 17 00:00:00 2001 From: Markus Date: Wed, 19 Jul 2023 10:15:56 +0200 Subject: [PATCH] [fix] added usertag as allowed html tags, so user highlighting works for the chat --- backend/src/middleware/helpers/cleanHtml.ts | 1 + webapp/components/Chat/Chat.vue | 6 ------ 2 files changed, 1 insertion(+), 6 deletions(-) diff --git a/backend/src/middleware/helpers/cleanHtml.ts b/backend/src/middleware/helpers/cleanHtml.ts index ac71f6bdc..84497760d 100644 --- a/backend/src/middleware/helpers/cleanHtml.ts +++ b/backend/src/middleware/helpers/cleanHtml.ts @@ -30,6 +30,7 @@ const standardSanitizeHtmlOptions = { 'strike', 'span', 'blockquote', + 'usertag', ], allowedAttributes: { a: ['href', 'class', 'target', 'data-*', 'contenteditable'], diff --git a/webapp/components/Chat/Chat.vue b/webapp/components/Chat/Chat.vue index d7864ebef..171d75f63 100644 --- a/webapp/components/Chat/Chat.vue +++ b/webapp/components/Chat/Chat.vue @@ -334,12 +334,6 @@ export default { }, async sendMessage(message) { - // check for usersTag and change userid to username - message.usersTag.forEach((userTag) => { - const needle = `${userTag.id}` - const replacement = `@${userTag.name.replaceAll(' ', '-').toLowerCase()}` - message.content = message.content.replaceAll(needle, replacement) - }) try { await this.$apollo.mutate({ mutation: createMessageMutation(),