Skip to content

An open-source, privacy-first, self-hosted knowledge workspace where humans and AI agents work together 开源、隐私优先、自托管的知识工作空间,让人与智能体在此协作

:art: Update av export

Daniel2f87e4b4c7c7
diff --git a/kernel/model/import.go b/kernel/model/import.go
index b7d44305df..383beedbdd 100644
--- a/kernel/model/import.go
+++ b/kernel/model/import.go
@@ -260,18 +260,13 @@ 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) {
+ newKey, newVal := k, v
for oldAvID, newAvID := range avIDs {
- newKey := strings.ReplaceAll(k, oldAvID, newAvID)
- newVal := strings.ReplaceAll(v, oldAvID, newAvID)
- if newKey != k {
- n.SetIALAttr(newKey, v)
- n.RemoveIALAttr(k)
- k = newKey
- }
- if newVal != v {
- n.SetIALAttr(k, newVal)
- }
+ newKey = strings.ReplaceAll(newKey, oldAvID, newAvID)
+ newVal = strings.ReplaceAll(newVal, oldAvID, newAvID)
}
+ n.RemoveIALAttr(k)
+ n.SetIALAttr(newKey, newVal)
}
}