This commit is contained in:
Timothy Jaeryang Baek
2026-07-27 02:29:56 -04:00
parent 98656b7c5e
commit e28b391e51
2 changed files with 3 additions and 4 deletions
@@ -113,8 +113,7 @@
const id = node.getAttribute('data-id') || '';
// TipTap stores the trigger char in data-mention-suggestion-char (usually "@")
const ch = node.getAttribute('data-mention-suggestion-char') || '@';
// Skills are always serialized as <$id|label>, even when selected from "/".
const mentionChar = id.includes('|') ? '$' : ch;
const mentionChar = ch === '/' ? '$' : ch;
return `<${mentionChar}${id}>`;
}
});
@@ -284,7 +283,8 @@
const getMentionText = ({ node, suggestion }) => {
const id = node.attrs.id ?? '';
const label = node.attrs.label ?? id;
const char = id.includes('|') ? '$' : (suggestion?.char ?? '@');
const ch = node.attrs.mentionSuggestionChar ?? suggestion?.char ?? '@';
const char = ch === '/' ? '$' : ch;
return `${char}${label}`;
};