From 943f4d7792cc73ad5b877583a9c1c3002dfea54b Mon Sep 17 00:00:00 2001 From: Liang Ding Date: Wed, 12 Oct 2022 11:44:04 +0800 Subject: [PATCH] =?UTF-8?q?:art:=20=E5=B5=8C=E5=85=A5=E5=9D=97=E6=B7=BB?= =?UTF-8?q?=E5=8A=A0=E9=9D=A2=E5=8C=85=E5=B1=91=20https://github.com/siyua?= =?UTF-8?q?n-note/siyuan/issues/2985?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- kernel/model/search.go | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/kernel/model/search.go b/kernel/model/search.go index ef53bc9da..61cf6bb4e 100644 --- a/kernel/model/search.go +++ b/kernel/model/search.go @@ -86,6 +86,18 @@ func searchEmbedBlock(stmt string, excludeIDs []string, headingMode int) (ret [] }) } + // 添加笔记本名称 + var boxIDs []string + for _, embedBlock := range ret { + boxIDs = append(boxIDs, embedBlock.Block.Box) + } + boxIDs = gulu.Str.RemoveDuplicatedElem(boxIDs) + boxNames := Conf.BoxNames(boxIDs) + for _, embedBlock := range ret { + name := boxNames[embedBlock.Block.Box] + embedBlock.Block.HPath = name + embedBlock.Block.HPath + } + if 1 > len(ret) { ret = []*EmbedBlock{} }