feat: $ skills mention

This commit is contained in:
Timothy Jaeryang Baek
2026-02-11 15:08:59 -06:00
parent 46aa54b7dc
commit f7c5965a70
8 changed files with 228 additions and 4 deletions
@@ -46,7 +46,7 @@
marked.use(footnoteExtension(options));
marked.use(disableSingleTilde);
marked.use({
extensions: [mentionExtension({ triggerChar: '@' }), mentionExtension({ triggerChar: '#' })]
extensions: [mentionExtension({ triggerChar: '@' }), mentionExtension({ triggerChar: '#' }), mentionExtension({ triggerChar: '$' })]
});
$: (async () => {
@@ -25,8 +25,23 @@
const init = () => {
const _id = token?.id;
// split by : and take first part as idType and second part as id
triggerChar = token?.triggerChar ?? '@';
if (triggerChar === '$') {
// Skill mention: id format is "skillId|label"
const pipeIdx = _id?.indexOf('|') ?? -1;
if (pipeIdx > 0) {
id = _id.substring(0, pipeIdx);
label = _id.substring(pipeIdx + 1);
} else {
id = _id;
label = _id;
}
idType = null;
return;
}
// split by : and take first part as idType and second part as id
const parts = _id?.split(':');
if (parts) {
idType = parts[0];
@@ -37,7 +52,6 @@
}
label = token?.label ?? id;
triggerChar = token?.triggerChar ?? '@';
if (triggerChar === '#') {
if (idType === 'C') {