Skip to content

An open-source, privacy-first, self-hosted knowledge workspace where humans and AI agents work together 开源、隐私优先、自托管的知识工作空间,让人与智能体在此协作

:bug: Execute built-in slash commands in Protyle Lite https://github.com/siyuan-note/siyuan/issues/19371

Danielad55196fc500
diff --git a/app/src/protyle/hint/index.ts b/app/src/protyle/hint/index.ts
index 5b259c3075..843585cd08 100644
--- a/app/src/protyle/hint/index.ts
+++ b/app/src/protyle/hint/index.ts
@@ -926,7 +926,9 @@ ${genHintItemHTML(item)}
blockRender(protyle, protyle.wysiwyg.element);
return;
} else if (this.splitChar === "/" || this.splitChar === "、") {
- if (protyle.lite) {
+ // 精简模式的自定义候选按文本插入,内置候选执行命令;块引用保留本地事务和后续提示。
+ if (protyle.lite && (Constants.BLOCK_HINT_KEYS.includes(value) ||
+ protyle.options.hint.extend.find((item) => item.key === "/" && item.hint)?.hint !== hintSlash)) {
insertHTML(value, protyle, false, false, false, undefined, undoContext);
if (Constants.BLOCK_HINT_KEYS.includes(value)) {
this.enableExtend = true;