Fix mentions in front-end + email spam

This commit is contained in:
Julien Nahum
2024-10-22 11:04:49 +02:00
parent dad5c825b1
commit 97c4b9db5b
3 changed files with 18 additions and 9 deletions

View File

@@ -14,7 +14,7 @@ export function useParseMention(content, mentionsAllowed, form, formData) {
const doc = parser.parseFromString(content, 'text/html')
// Find all elements with mention attribute
const mentionElements = doc.querySelectorAll('[mention]')
const mentionElements = doc.querySelectorAll('[mention], [mention=""]')
mentionElements.forEach(element => {
const fieldId = element.getAttribute('mention-field-id')
@@ -36,4 +36,4 @@ export function useParseMention(content, mentionsAllowed, form, formData) {
// Return the processed HTML content
return doc.body.innerHTML
}
}