Skip to content

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

:bug: 导入 Markdown 文件报错 Fix https://github.com/siyuan-note/siyuan/issues/5781

Liang Ding7d39c6447e88
diff --git a/kernel/model/import.go b/kernel/model/import.go
index aa45d8458e..5a46b8c49c 100644
--- a/kernel/model/import.go
+++ b/kernel/model/import.go
@@ -127,7 +127,7 @@ func ImportSY(zipPath, boxID, toPath string) (err error) {
if ast.NodeBlockRefID == n.Type {
newDefID := blockIDs[n.TokensStr()]
if "" != newDefID {
- n.Tokens = gulu.Str.ToBytes(newDefID)
+ n.Tokens = []byte(newDefID)
} else {
logging.LogWarnf("not found def [" + n.TokensStr() + "]")
}
@@ -486,7 +486,7 @@ func ImportFromLocalPath(boxID, localPath string, toPath string) (err error) {
} else {
name = existName
}
- n.Tokens = gulu.Str.ToBytes("assets/" + name)
+ n.Tokens = []byte("assets/" + name)
}
return ast.WalkContinue
})
@@ -570,7 +570,7 @@ func ImportFromLocalPath(boxID, localPath string, toPath string) (err error) {
logging.LogErrorf("copy asset from [%s] to [%s] failed: %s", absolutePath, assetTargetPath, err)
return ast.WalkContinue
}
- n.Tokens = gulu.Str.ToBytes("assets/" + name)
+ n.Tokens = []byte("assets/" + name)
}
return ast.WalkContinue
})