diff --git a/webapp/components/Editor/Editor.vue b/webapp/components/Editor/Editor.vue index d145e220a..6f6f9ed4f 100644 --- a/webapp/components/Editor/Editor.vue +++ b/webapp/components/Editor/Editor.vue @@ -240,8 +240,10 @@ export default { selectItem(item) { const typeAttrs = { mention: { - id: item.id, - dataMentionId: item.dataMentionId ?? item.id, + id: { hrefId: item.id, dataMentionId: item.dataMentionId ?? item.id }, + // this solution would better, but "dataMentionId" is then undefined in "webapp/components/Editor/nodes/Mention.js" > "toDOM" + // id: item.id, + // dataMentionId: item.dataMentionId ?? item.id, label: item.slug, }, hashtag: { diff --git a/webapp/components/Editor/nodes/Mention.js b/webapp/components/Editor/nodes/Mention.js index 696667742..3742233a6 100644 --- a/webapp/components/Editor/nodes/Mention.js +++ b/webapp/components/Editor/nodes/Mention.js @@ -13,8 +13,12 @@ export default class Mention extends TipTapMention { 'a', { class: this.options.mentionClass, - href: `/profile/${node.attrs.id}`, - 'data-mention-id': node.attrs.dataMentionId, + href: `/profile/${node.attrs.id.hrefId}`, + 'data-mention-id': + node.attrs.id.dataMentionId !== undefined ? node.attrs.id.dataMentionId : 'undefined', + // better solution that doesn't work, see "webapp/components/Editor/Editor.vue" > "selectItem" + // href: `/profile/${node.attrs.id}`, + // 'data-mention-id': node.attrs.dataMentionId, // "dataMentionId" is undefined target: '_blank', }, `${this.options.matcher.char}${node.attrs.label} `,