Merge remote-tracking branch 'origin/dev' into dev

This commit is contained in:
Vanessa 2025-11-22 19:44:03 +08:00
commit 67723aab28
5 changed files with 17 additions and 44 deletions

File diff suppressed because one or more lines are too long

View file

@ -8,7 +8,7 @@ require (
github.com/88250/epub v0.0.0-20230830085737-c19055cd1f48
github.com/88250/go-humanize v0.0.0-20240424102817-4f78fac47ea7
github.com/88250/gulu v1.2.3-0.20251119142510-7b1583ab4aa0
github.com/88250/lute v1.7.7-0.20251121015707-e61322b7a332
github.com/88250/lute v1.7.7-0.20251122104311-8bc4c75a8f91
github.com/88250/vitess-sqlparser v0.0.0-20210205111146-56a2ded2aba1
github.com/ClarkThan/ahocorasick v0.0.0-20231011042242-30d1ef1347f4
github.com/ConradIrwin/font v0.2.1

View file

@ -14,8 +14,8 @@ github.com/88250/go-sqlite3 v1.14.13-0.20231214121541-e7f54c482950 h1:Pa5hMiBceT
github.com/88250/go-sqlite3 v1.14.13-0.20231214121541-e7f54c482950/go.mod h1:NyWgC/yNuGj7Q9rpYnZvas74GogHl5/Z4A/KQRfk6bU=
github.com/88250/gulu v1.2.3-0.20251119142510-7b1583ab4aa0 h1:ip0IQCJCLtJEDHil+2XSnh3NP39i98SYV5qhWoUeMnA=
github.com/88250/gulu v1.2.3-0.20251119142510-7b1583ab4aa0/go.mod h1:IQ5dXW9CjVmx6B7OfK1Y4ZBKTPMe9q1AkVoLGGzRbS8=
github.com/88250/lute v1.7.7-0.20251121015707-e61322b7a332 h1:rL+puyajSiPpdFXHYSTYLgt2F+cQY82/ly3m3geZYBs=
github.com/88250/lute v1.7.7-0.20251121015707-e61322b7a332/go.mod h1:WYyUw//5yVw9BJnoVjx7rI/3szsISxNZCYGOqTIrV0o=
github.com/88250/lute v1.7.7-0.20251122104311-8bc4c75a8f91 h1:uGTZqI/HYFrkr7M+ZH78QYDCsOrFYOwr7MXfL3t06ww=
github.com/88250/lute v1.7.7-0.20251122104311-8bc4c75a8f91/go.mod h1:WYyUw//5yVw9BJnoVjx7rI/3szsISxNZCYGOqTIrV0o=
github.com/88250/pdfcpu v0.3.14-0.20250424122812-f10e8d9d8d46 h1:Bq1JsDfVbHKUxNL/B2JXd8cC/1h6aFjrlXpGycnh0Hk=
github.com/88250/pdfcpu v0.3.14-0.20250424122812-f10e8d9d8d46/go.mod h1:fVfOloBzs2+W2VJCCbq60XIxc3yJHAZ0Gahv1oO0gyI=
github.com/88250/vitess-sqlparser v0.0.0-20210205111146-56a2ded2aba1 h1:48T899JQDwyyRu9yXHePYlPdHtpJfrJEUGBMH3SMBWY=

View file

@ -981,24 +981,15 @@ func DuplicateDoc(tree *parse.Tree) {
}
FlushTxQueue()
// 复制为副本时将该副本块插入到数据库中 https://github.com/siyuan-note/siyuan/issues/11959
// 复制为副本时移除数据库绑定状态 https://github.com/siyuan-note/siyuan/issues/12294
ast.Walk(tree.Root, func(n *ast.Node, entering bool) ast.WalkStatus {
if !entering || !n.IsBlock() {
return ast.WalkContinue
}
avs := n.IALAttr(av.NodeAttrNameAvs)
for _, avID := range strings.Split(avs, ",") {
if !ast.IsNodeIDPattern(avID) {
continue
}
AddAttributeViewBlock(nil, []map[string]interface{}{{
"id": n.ID,
"isDetached": false,
}}, avID, "", "", "", "", false, map[string]interface{}{})
ReloadAttrView(avID)
}
n.RemoveIALAttr(av.NodeAttrNameAvs)
n.RemoveIALAttr(av.NodeAttrViewNames)
n.RemoveIALAttrsByPrefix(av.NodeAttrViewStaticText)
return ast.WalkContinue
})
return

View file

@ -1206,19 +1206,10 @@ func (tx *Transaction) doLargeInsert(previousID string) (ret *TxErr) {
upsertAvBlockRel(insertedNode)
// 复制为副本时将该副本块插入到数据库中 https://github.com/siyuan-note/siyuan/issues/11959
avs := insertedNode.IALAttr(av.NodeAttrNameAvs)
for _, avID := range strings.Split(avs, ",") {
if !ast.IsNodeIDPattern(avID) {
continue
}
AddAttributeViewBlock(tx, []map[string]interface{}{{
"id": insertedNode.ID,
"isDetached": false,
}}, avID, "", "", "", previousID, false, map[string]interface{}{})
ReloadAttrView(avID)
}
// 复制为副本时移除数据库绑定状态 https://github.com/siyuan-note/siyuan/issues/12294
insertedNode.RemoveIALAttr(av.NodeAttrNameAvs)
insertedNode.RemoveIALAttr(av.NodeAttrViewNames)
insertedNode.RemoveIALAttrsByPrefix(av.NodeAttrViewStaticText)
if ast.NodeAttributeView == insertedNode.Type {
// 插入数据库块时需要重新绑定其中已经存在的块
@ -1394,19 +1385,10 @@ func (tx *Transaction) doInsert(operation *Operation) (ret *TxErr) {
upsertAvBlockRel(insertedNode)
// 复制为副本时将该副本块插入到数据库中 https://github.com/siyuan-note/siyuan/issues/11959
avs := insertedNode.IALAttr(av.NodeAttrNameAvs)
for _, avID := range strings.Split(avs, ",") {
if !ast.IsNodeIDPattern(avID) {
continue
}
AddAttributeViewBlock(tx, []map[string]interface{}{{
"id": insertedNode.ID,
"isDetached": false,
}}, avID, "", "", "", previousID, false, map[string]interface{}{})
ReloadAttrView(avID)
}
// 复制为副本时移除数据库绑定状态 https://github.com/siyuan-note/siyuan/issues/12294
insertedNode.RemoveIALAttr(av.NodeAttrNameAvs)
insertedNode.RemoveIALAttr(av.NodeAttrViewNames)
insertedNode.RemoveIALAttrsByPrefix(av.NodeAttrViewStaticText)
if ast.NodeAttributeView == insertedNode.Type {
// 插入数据库块时需要重新绑定其中已经存在的块