mirror of
https://github.com/Ocelot-Social-Community/Ocelot-Social.git
synced 2025-12-13 07:46:06 +00:00
[fix] added usertag as allowed html tags, so user highlighting works for the chat
This commit is contained in:
parent
7dbae3f5c4
commit
0bc19cf226
@ -30,6 +30,7 @@ const standardSanitizeHtmlOptions = {
|
||||
'strike',
|
||||
'span',
|
||||
'blockquote',
|
||||
'usertag',
|
||||
],
|
||||
allowedAttributes: {
|
||||
a: ['href', 'class', 'target', 'data-*', 'contenteditable'],
|
||||
|
||||
@ -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(),
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user