refactor: simplify command dispatch and update cmd-link

- Simplify `dispatchCommand` by removing role-based logic and ensuring
  commands are prefixed with a slash.
- Change `:cmd[]` directive output from a `span` to an `a` tag.
- Update `.cmd-link` styles to improve link appearance and prevent
  text selection.
This commit is contained in:
2026-07-12 14:18:01 +08:00
parent 42e8971ff7
commit d690d5922e
3 changed files with 10 additions and 27 deletions
+1 -1
View File
@@ -24,7 +24,7 @@ export const cmdDirective = {
const label = (token.attrs?.label as string) || command;
return `<span class="cmd-link" data-cmd="${escapeAttr(command)}" role="button" tabindex="0">${escapeHtml(label)}</span>`;
return `<a class="cmd-link" data-cmd="${escapeAttr(command)}">${escapeHtml(label)}</a>`;
},
};