🎨 Update av export
This commit is contained in:
parent
cd8b537465
commit
2f87e4b4c7
1 changed files with 5 additions and 10 deletions
|
@ -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)
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue