An open-source, privacy-first, self-hosted knowledge workspace where humans and AI agents work together 开源、隐私优先、自托管的知识工作空间,让人与智能体在此协作
TypeScript agentic-aiai-agentknowledge-baselocal-firstmarkdownmcpmindmapnote-takingself-hostedsiyuanworkspace
:art: Improve backmention highlighting https://github.com/siyuan-note/siyuan/issues/14103
Daniel6080f86693db
diff --git a/kernel/model/backlink.go b/kernel/model/backlink.goindex 9ab52c9602..0ed8df473b 100644--- a/kernel/model/backlink.go+++ b/kernel/model/backlink.go@@ -748,11 +748,11 @@ func buildTreeBackmention(defSQLBlock *sql.Block, refBlocks []*Block, keyword stmentionKeywords = append(mentionKeywords, v.(string))}mentionKeywords = prepareMarkKeywords(mentionKeywords)- ret = searchBackmention(mentionKeywords, keyword, excludeBacklinkIDs, rootID, beforeLen)+ mentionKeywords, ret = searchBackmention(mentionKeywords, keyword, excludeBacklinkIDs, rootID, beforeLen)return}-func searchBackmention(mentionKeywords []string, keyword string, excludeBacklinkIDs *hashset.Set, rootID string, beforeLen int) (ret []*Block) {+func searchBackmention(mentionKeywords []string, keyword string, excludeBacklinkIDs *hashset.Set, rootID string, beforeLen int) (retMentionKeywords []string, ret []*Block) {ret = []*Block{}if 1 > len(mentionKeywords) {return@@ -825,6 +825,9 @@ func searchBackmention(mentionKeywords []string, keyword string, excludeBacklinknewText := markReplaceSpanWithSplit(text, mentionKeywords, search.GetMarkSpanStart(search.MarkDataType), search.GetMarkSpanEnd())if text != newText {tmp = append(tmp, b)++ k := gulu.Str.SubstringsBetween(newText, search.GetMarkSpanStart(search.MarkDataType), search.GetMarkSpanEnd())+ retMentionKeywords = append(retMentionKeywords, k...)} else {// columnFilter 中的命名、别名和备注命中的情况// 反链提及搜索范围增加命名、别名和备注 https://github.com/siyuan-note/siyuan/issues/7639@@ -836,6 +839,8 @@ func searchBackmention(mentionKeywords []string, keyword string, excludeBacklink}}blocks = tmp+ retMentionKeywords = gulu.Str.RemoveDuplicatedElem(retMentionKeywords)+ mentionKeywords = retMentionKeywordsmentionBlockMap := map[string]*Block{}for _, block := range blocks {