Skip to content

An open-source, privacy-first, self-hosted knowledge workspace where humans and AI agents work together 开源、隐私优先、自托管的知识工作空间,让人与智能体在此协作

:art: Deduplicate container block backlink https://github.com/siyuan-note/siyuan/issues/13872

Daniel557b9ae37e71
diff --git a/kernel/model/backlink.go b/kernel/model/backlink.go
index 0dc0bb0274..cebcfbe94b 100644
--- a/kernel/model/backlink.go
+++ b/kernel/model/backlink.go
@@ -586,7 +586,10 @@ func buildLinkRefs(defRootID string, refs []*sql.Ref, keywords []string) (ret []
}
}
}
+ refsCountDelta := len(paragraphParentIDs)
paragraphParentIDs = gulu.Str.RemoveDuplicatedElem(paragraphParentIDs)
+ refsCountDelta -= len(paragraphParentIDs)
+ refsCount -= refsCountDelta
sqlParagraphParents := sql.GetBlocks(paragraphParentIDs)
paragraphParents := fromSQLBlocks(&sqlParagraphParents, "", 12)