[fix] added usertag as allowed html tags, so user highlighting works for the chat

This commit is contained in:
Markus 2023-07-19 10:15:56 +02:00
parent 7dbae3f5c4
commit 0bc19cf226
2 changed files with 1 additions and 6 deletions

View File

@ -30,6 +30,7 @@ const standardSanitizeHtmlOptions = {
'strike',
'span',
'blockquote',
'usertag',
],
allowedAttributes: {
a: ['href', 'class', 'target', 'data-*', 'contenteditable'],

View File

@ -334,12 +334,6 @@ export default {
},
async sendMessage(message) {
// check for usersTag and change userid to username
message.usersTag.forEach((userTag) => {
const needle = `<usertag>${userTag.id}</usertag>`
const replacement = `<usertag>@${userTag.name.replaceAll(' ', '-').toLowerCase()}</usertag>`
message.content = message.content.replaceAll(needle, replacement)
})
try {
await this.$apollo.mutate({
mutation: createMessageMutation(),