Skip to content

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

:bug: Incorrect rtfd file handling when `Insert image or file` on macOS https://github.com/siyuan-note/siyuan/issues/9585

Danielaf93409a1747
diff --git a/kernel/model/assets.go b/kernel/model/assets.go
index 72f29aebde..7d148a95cc 100644
--- a/kernel/model/assets.go
+++ b/kernel/model/assets.go
@@ -907,6 +907,12 @@ func assetsLinkDestsInTree(tree *parse.Tree) (ret []string) {
return ast.WalkContinue
})
ret = gulu.Str.RemoveDuplicatedElem(ret)
+ for i, dest := range ret {
+ // 对于 macOS 的 rtfd 文件夹格式需要特殊处理,为其加上结尾 /
+ if strings.HasSuffix(dest, ".rtfd") {
+ ret[i] = dest + "/"
+ }
+ }
return
}