This commit is contained in:
Liang Ding 2022-09-16 19:42:13 +08:00
parent 02d9245bcf
commit e2e929538b
No known key found for this signature in database
GPG key ID: 136F30F901A2231D

View file

@ -124,12 +124,17 @@ func ImportSY(zipPath, boxID, toPath string) (err error) {
if !entering {
return ast.WalkContinue
}
if ast.NodeBlockRefID == n.Type {
newDefID := blockIDs[n.TokensStr()]
if treenode.IsBlockRef(n) {
defID, _, _ := treenode.GetBlockRef(n)
newDefID := blockIDs[defID]
if "" != newDefID {
n.Tokens = []byte(newDefID)
} else {
logging.LogWarnf("not found def [" + n.TokensStr() + "]")
if ast.NodeBlockRef == n.Type {
if id := n.ChildByType(ast.NodeBlockRefID); nil != id {
id.Tokens = []byte(newDefID)
}
} else {
n.TextMarkBlockRefID = newDefID
}
}
} else if ast.NodeBlockQueryEmbedScript == n.Type {
for oldID, newID := range blockIDs {