Skip to content

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

:art: 支持通过界面设置代码片段 https://github.com/siyuan-note/siyuan/issues/6357

Liang Ding5784b0711c38
diff --git a/kernel/model/snippet.go b/kernel/model/snippet.go
index d4f66ab06a..e822cd7ccd 100644
--- a/kernel/model/snippet.go
+++ b/kernel/model/snippet.go
@@ -21,6 +21,7 @@ import (
"sync"
"github.com/88250/gulu"
+ "github.com/88250/lute/ast"
"github.com/siyuan-note/filelock"
"github.com/siyuan-note/logging"
"github.com/siyuan-note/siyuan/kernel/conf"
@@ -106,7 +107,7 @@ func loadSnippets() (ret []*conf.Snippet, err error) {
needRewrite := false
for _, snippet := range ret {
if "" == snippet.ID {
- snippet.ID = gulu.Rand.String(12)
+ snippet.ID = ast.NewNodeID()
needRewrite = true
}
}