From 5784b0711c3801768e5e8ee7c7075ac761f07b47 Mon Sep 17 00:00:00 2001 From: Liang Ding Date: Thu, 27 Oct 2022 11:57:01 +0800 Subject: [PATCH] =?UTF-8?q?:art:=20=E6=94=AF=E6=8C=81=E9=80=9A=E8=BF=87?= =?UTF-8?q?=E7=95=8C=E9=9D=A2=E8=AE=BE=E7=BD=AE=E4=BB=A3=E7=A0=81=E7=89=87?= =?UTF-8?q?=E6=AE=B5=20https://github.com/siyuan-note/siyuan/issues/6357?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- kernel/model/snippet.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/kernel/model/snippet.go b/kernel/model/snippet.go index d4f66ab06..e822cd7cc 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 } }