From efefa9baafb9008adb58508ed776f00be77cf8f8 Mon Sep 17 00:00:00 2001 From: Liang Ding Date: Sun, 2 Oct 2022 12:01:17 +0800 Subject: [PATCH] =?UTF-8?q?:sparkles:=20=E7=BC=96=E8=BE=91=E5=99=A8?= =?UTF-8?q?=E5=BC=8F=E5=8F=8D=E9=93=BE=E9=9D=A2=E6=9D=BF=20https://github.?= =?UTF-8?q?com/siyuan-note/siyuan/issues/3565?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- kernel/api/ref.go | 2 +- kernel/model/backlink.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/kernel/api/ref.go b/kernel/api/ref.go index 02b0ee37b..29ca48289 100644 --- a/kernel/api/ref.go +++ b/kernel/api/ref.go @@ -90,7 +90,7 @@ func getBacklink(c *gin.Context) { keyword := arg["k"].(string) mentionKeyword := arg["mk"].(string) beforeLen := arg["beforeLen"].(float64) - boxID, backlinks, backmentions, linkRefsCount, mentionsCount := model.BuildTreeBacklink(id, keyword, mentionKeyword, int(beforeLen)) + boxID, backlinks, backmentions, linkRefsCount, mentionsCount := model.GetBacklink(id, keyword, mentionKeyword, int(beforeLen)) ret.Data = map[string]interface{}{ "backlinks": backlinks, "linkRefsCount": linkRefsCount, diff --git a/kernel/model/backlink.go b/kernel/model/backlink.go index 8586aa349..65013e3d0 100644 --- a/kernel/model/backlink.go +++ b/kernel/model/backlink.go @@ -297,7 +297,7 @@ func buildBacklink(refID string, refTree *parse.Tree, luteEngine *lute.Lute) (re return } -func BuildTreeBacklink(id, keyword, mentionKeyword string, beforeLen int) (boxID string, backlinks, backmentions []*Path, linkRefsCount, mentionsCount int) { +func GetBacklink(id, keyword, mentionKeyword string, beforeLen int) (boxID string, backlinks, backmentions []*Path, linkRefsCount, mentionsCount int) { keyword = strings.TrimSpace(keyword) mentionKeyword = strings.TrimSpace(mentionKeyword) backlinks, backmentions = []*Path{}, []*Path{}