migrate from github
This commit is contained in:
@@ -0,0 +1,16 @@
|
||||
/**
|
||||
* Extract all unique mentioned user external IDs from the Tiptap editor state.
|
||||
*
|
||||
* @param {import('@tiptap/vue-3').Editor} editor
|
||||
* @returns {string[]}
|
||||
*/
|
||||
export function extractMentionIds(editor) {
|
||||
if (!editor) return [];
|
||||
const ids = [];
|
||||
editor.state.doc.descendants((node) => {
|
||||
if (node.type.name === 'mention' && node.attrs.id) {
|
||||
ids.push(node.attrs.id);
|
||||
}
|
||||
});
|
||||
return [...new Set(ids)];
|
||||
}
|
||||
Reference in New Issue
Block a user