From 905403ba10b45e1e377299a7818e9c2d65a9e172 Mon Sep 17 00:00:00 2001 From: Daniel <845765@qq.com> Date: Sun, 5 Jan 2025 00:53:55 +0800 Subject: [PATCH 1/2] :art: Database-bound block primary key supports setting static anchor text https://github.com/siyuan-note/siyuan/issues/10049 --- kernel/model/attribute_view.go | 2 +- kernel/model/transaction.go | 9 ++++++++- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/kernel/model/attribute_view.go b/kernel/model/attribute_view.go index 93f7fcbb6..3fe2a53b2 100644 --- a/kernel/model/attribute_view.go +++ b/kernel/model/attribute_view.go @@ -3147,7 +3147,7 @@ func UpdateAttributeViewCell(tx *Transaction, avID, keyID, rowID string, valueDa if blockText == content { updateStaticText = false } else { - val.Block.Content = blockText + val.Block.Content = content } } diff --git a/kernel/model/transaction.go b/kernel/model/transaction.go index 2f4ab6114..86fb53343 100644 --- a/kernel/model/transaction.go +++ b/kernel/model/transaction.go @@ -1313,10 +1313,17 @@ func upsertAvBlockRel(node *ast.Node) { }) } - affectedAvIDs = gulu.Str.RemoveDuplicatedElem(affectedAvIDs) go func() { time.Sleep(100 * time.Millisecond) sql.FlushQueue() + + affectedAvIDs = gulu.Str.RemoveDuplicatedElem(affectedAvIDs) + var relatedAvIDs []string + for _, avID := range affectedAvIDs { + relatedAvIDs = append(relatedAvIDs, av.GetSrcAvIDs(avID)...) + } + affectedAvIDs = append(affectedAvIDs, relatedAvIDs...) + affectedAvIDs = gulu.Str.RemoveDuplicatedElem(affectedAvIDs) for _, avID := range affectedAvIDs { ReloadAttrView(avID) } From d3ba886b7a626e3a0ba1a7e19d6dedbcc4c83341 Mon Sep 17 00:00:00 2001 From: Daniel <845765@qq.com> Date: Sun, 5 Jan 2025 00:56:37 +0800 Subject: [PATCH 2/2] :art: Backlink contain children by default --- kernel/conf/editor.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/kernel/conf/editor.go b/kernel/conf/editor.go index 607a0e912..cffeb0534 100644 --- a/kernel/conf/editor.go +++ b/kernel/conf/editor.go @@ -87,7 +87,7 @@ func NewEditor() *Editor { RTL: false, BacklinkExpandCount: 8, BackmentionExpandCount: -1, - BacklinkContainChildren: false, + BacklinkContainChildren: true, Markdown: util.MarkdownSettings, } }