🎨 插入资源文件时文件名长度最大限制 189 字节 https://github.com/siyuan-note/siyuan/issues/7099

This commit is contained in:
Liang Ding 2023-01-20 11:27:28 +08:00
parent b3b1f3e6a5
commit 92ca6fd339
No known key found for this signature in database
GPG key ID: 136F30F901A2231D
2 changed files with 19 additions and 3 deletions

View file

@ -176,8 +176,8 @@ func NetImg2LocalAssets(rootID string) (err error) {
}
}
name = strings.TrimSuffix(name, ext)
name = gulu.Str.SubStr(name, 63) // 插入资源文件时文件名长度最大限制 63 个字 https://github.com/siyuan-note/siyuan/issues/7099
name = util.FilterFileName(name)
name = util.TruncateLenFileName(name)
name = "net-img-" + name + "-" + ast.NewNodeID() + ext
writePath := filepath.Join(assetsDirPath, name)
if err = filelock.WriteFile(writePath, data); nil != err {