🎨 Database values no longer correspond to block attributes Fix https://github.com/siyuan-note/siyuan/issues/9293

This commit is contained in:
Daniel 2023-09-27 15:51:27 +08:00
parent ad53100fd1
commit c1bc0c2b0e
No known key found for this signature in database
GPG key ID: 86211BA83DF03017
3 changed files with 12 additions and 16 deletions

View file

@ -153,10 +153,8 @@ func ImportSY(zipPath, boxID, toPath string) (err error) {
// 重新指向数据库属性值
ial := parse.IAL2Map(n.KramdownIAL)
for k, v := range ial {
if strings.HasPrefix(k, NodeAttrNamePrefixAvKey) {
v = strings.ReplaceAll(v, oldNodeID, newNodeID)
n.SetIALAttr(k, v)
for k, _ := range ial {
if strings.HasPrefix(k, NodeAttrNameAvs) {
avBlockIDs[oldNodeID] = newNodeID
}
}
@ -259,7 +257,7 @@ func ImportSY(zipPath, boxID, toPath string) (err error) {
ial := parse.IAL2Map(n.KramdownIAL)
for k, v := range ial {
if strings.HasPrefix(k, NodeAttrNamePrefixAvKey) || strings.HasPrefix(k, NodeAttrNameAvs) {
if strings.HasPrefix(k, NodeAttrNameAvs) {
newKey, newVal := k, v
for oldAvID, newAvID := range avIDs {
newKey = strings.ReplaceAll(newKey, oldAvID, newAvID)