Skip to content

Commit

Permalink
✨ 行级元素支持多重样式类型 siyuan-note#2911
Browse files Browse the repository at this point in the history
  • Loading branch information
88250 authored and leolee9086 committed Oct 4, 2022
1 parent 4b7e196 commit 0bb0c68
Showing 1 changed file with 10 additions and 5 deletions.
15 changes: 10 additions & 5 deletions kernel/model/import.go
Expand Up @@ -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 {
Expand Down

0 comments on commit 0bb0c68

Please sign in to comment.