An open-source, privacy-first, self-hosted knowledge workspace where humans and AI agents work together 开源、隐私优先、自托管的知识工作空间,让人与智能体在此协作
TypeScript agentic-aiai-agentknowledge-baselocal-firstmarkdownmcpmindmapnote-takingself-hostedsiyuanworkspace
:art: Improve the setting of custom attribute names https://github.com/siyuan-note/siyuan/issues/16447
Danielb55b99546e3f
diff --git a/kernel/model/blockial.go b/kernel/model/blockial.goindex c7637b8f8b..7ddcd8807b 100644--- a/kernel/model/blockial.go+++ b/kernel/model/blockial.go@@ -233,6 +233,8 @@ func setNodeAttrs0(node *ast.Node, nameValues map[string]string) (oldAttrs map[s}}+ normalizeKeysToLower(nameValues)+for name, value := range nameValues {value = util.RemoveInvalidRetainCtrl(value)value = strings.TrimSpace(value)@@ -250,6 +252,23 @@ func setNodeAttrs0(node *ast.Node, nameValues map[string]string) (oldAttrs map[sreturn}+// normalizeKeysToLower 将 nameValues 的键统一为小写 https://github.com/siyuan-note/siyuan/issues/16447+func normalizeKeysToLower(nameValues map[string]string) {+ newMap := make(map[string]string, len(nameValues))+ for name, value := range nameValues {+ lower := strings.ToLower(name)+ newMap[lower] = value+ }++ for k := range nameValues {+ delete(nameValues, k)+ }++ for k, v := range newMap {+ nameValues[k] = v+ }+}+func pushBroadcastAttrTransactions(oldAttrs map[string]string, node *ast.Node) {newAttrs := parse.IAL2Map(node.KramdownIAL)data := map[string]interface{}{"old": oldAttrs, "new": newAttrs}