mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-12-31 13:58:49 +01:00
🎨 文档数据文件名不符合 ID 格式时自动移动到 corrupted 文件夹下 Fix https://github.com/siyuan-note/siyuan/issues/7343
This commit is contained in:
parent
5c596f142c
commit
698f130ffa
1 changed files with 6 additions and 0 deletions
|
|
@ -128,6 +128,12 @@ func resetDuplicateTrees() {
|
|||
duplicatedPaths := map[string]string{}
|
||||
for p, absPath := range paths {
|
||||
name := path.Base(p)
|
||||
if !ast.IsNodeIDPattern(strings.TrimSuffix(name, ".sy")) {
|
||||
logging.LogWarnf("invalid .sy file name [%s]", p)
|
||||
box.moveCorruptedData(absPath)
|
||||
continue
|
||||
}
|
||||
|
||||
if !names[name] {
|
||||
names[name] = true
|
||||
continue
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue