Skip to content
Source
Sign inSign up
pingdotgg/t3code

fix(cursor): populate skill catalog and keep spaced names as one chip #8982

Closedmikeastock-bot(GitHub profile, opens in a new tab)wants to merge 2 commits intomain fromrefs/pull/8982/headopened View on GitHub

Showing 23 changed files with 31 additions and 4 deletions (loading 20).

x
0 of 23 viewed, 23 left
4 additions and 3 deletionsapps/mobile/modules/t3-markdown-text/src/nativeMarkdownText.tsModified
View file
@@ -191,7 +191,7 @@
return runs;
​
-const SKILL_TOKEN_REGEX = /(^|\s)\$([a-zA-Z][a-zA-Z0-9:_-]*)(?=\s|$)/g;
+const SKILL_TOKEN_REGEX = /(^|\s)\$(?:"((?:\\.|[^"\\])*)"|([a-zA-Z][a-zA-Z0-9:_-]*))(?=\s|$)/g;
​
function formatSkillLabel(skill: SelectableMarkdownSkill): string {
const displayName = skill.displayName?.trim();
@@ -225,13 +225,14 @@
let matched = false;
for (const match of run.text.matchAll(SKILL_TOKEN_REGEX)) {
const prefix = match[1] ?? "";
- const name = match[2] ?? "";
+ const quotedName = match[2];
+ const name = quotedName !== undefined ? quotedName.replace(/\\(.)/g, "$1") : (match[3] ?? "");
const skill = skillByName.get(name);
if (!skill) {
continue;
const start = (match.index ?? 0) + prefix.length;
- const end = start + name.length + 1;
+ const end = start + match[0].length - prefix.length;
if (start > cursor) {
decorated.push({ ...run, text: run.text.slice(cursor, start) });
2 additions and 1 deletionapps/mobile/src/features/threads/use-composer-command-menu.tsModified
View file