🐛 File names ending with . will be considered as missing assets

🎨 Improve HTML clipping https://github.com/siyuan-note/siyuan/issues/13355
This commit is contained in:
Daniel 2024-12-04 22:37:22 +08:00
parent 821a58d895
commit 22190b532d
No known key found for this signature in database
GPG key ID: 86211BA83DF03017
8 changed files with 36 additions and 25 deletions

View file

@ -25,7 +25,6 @@ import (
"strings"
"github.com/88250/gulu"
"github.com/88250/lute/ast"
"github.com/gin-gonic/gin"
"github.com/siyuan-note/filelock"
"github.com/siyuan-note/logging"
@ -87,9 +86,7 @@ func InsertLocalAssets(id string, assetPaths []string, isUpload bool) (succMap m
// 已经存在同样数据的资源文件的话不重复保存
succMap[baseName] = existAsset.Path
} else {
ext := path.Ext(fName)
fName = fName[0 : len(fName)-len(ext)]
fName = fName + "-" + ast.NewNodeID() + ext
fName = util.AssetName(fName)
writePath := filepath.Join(assetsDirPath, fName)
if _, err = f.Seek(0, io.SeekStart); err != nil {
f.Close()