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

This commit is contained in:
Daniel 2023-11-04 10:30:05 +08:00
parent 82373ff3e9
commit af93409a17
No known key found for this signature in database
GPG key ID: 86211BA83DF03017

View file

@ -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
}