Fix mentions in front-end + email spam
This commit is contained in:
4
client/composables/useParseMention.js
vendored
4
client/composables/useParseMention.js
vendored
@@ -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
|
||||
}
|
||||
}
|
||||
|
||||
4
client/lib/quill/quillMentionExtension.js
vendored
4
client/lib/quill/quillMentionExtension.js
vendored
@@ -18,7 +18,7 @@ export default function registerMentionExtension(Quill) {
|
||||
node.setAttribute('mention', 'true')
|
||||
|
||||
if (data && typeof data === 'object') {
|
||||
node.setAttribute('mention-field-id', data.field?.nf_id || '')
|
||||
node.setAttribute('mention-field-id', data.field?.id || '')
|
||||
node.setAttribute('mention-field-name', data.field?.name || '')
|
||||
node.setAttribute('mention-fallback', data.fallback || '')
|
||||
node.textContent = data.field?.name || ''
|
||||
@@ -53,7 +53,7 @@ export default function registerMentionExtension(Quill) {
|
||||
static value(domNode) {
|
||||
return {
|
||||
field: {
|
||||
nf_id: domNode.getAttribute('mention-field-id') || '',
|
||||
id: domNode.getAttribute('mention-field-id') || '',
|
||||
name: domNode.getAttribute('mention-field-name') || ''
|
||||
},
|
||||
fallback: domNode.getAttribute('mention-fallback') || ''
|
||||
|
||||
Reference in New Issue
Block a user