This commit is contained in:
Liang Ding 2022-07-15 11:11:54 +08:00
parent f29bf51c12
commit f39750e393
No known key found for this signature in database
GPG key ID: 136F30F901A2231D

View file

@ -453,8 +453,16 @@ func RenameAsset(oldPath, newName string) {
return
}
newPath := util.AssetName(newName)
newName = strings.TrimSpace(newName)
newName = gulu.Str.RemoveInvisible(newName)
if path.Base(oldPath) == newName {
return
}
if "" == newName {
return
}
newPath := util.AssetName(newName)
luteEngine := NewLute()
for _, notebook := range notebooks {
pages := pagedPaths(filepath.Join(util.DataDir, notebook.ID), 32)