Skip to content

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

:sparkles: 编辑器式反链面板 https://github.com/siyuan-note/siyuan/issues/3565

Liang Dingc4a4523cdfa1
diff --git a/kernel/api/ref.go b/kernel/api/ref.go
index d3ec6271e5..682b76fa82 100644
--- a/kernel/api/ref.go
+++ b/kernel/api/ref.go
@@ -73,7 +73,6 @@ func getBacklinkDoc(c *gin.Context) {
}
}
-
func getBacklink2(c *gin.Context) {
ret := gulu.Ret.NewResult()
defer c.JSON(http.StatusOK, ret)
@@ -118,8 +117,11 @@ func getBacklink(c *gin.Context) {
id := arg["id"].(string)
keyword := arg["k"].(string)
mentionKeyword := arg["mk"].(string)
- beforeLen := arg["beforeLen"].(float64)
- boxID, backlinks, backmentions, linkRefsCount, mentionsCount := model.GetBacklink(id, keyword, mentionKeyword, int(beforeLen))
+ beforeLen := 12
+ if nil != arg["beforeLen"] {
+ beforeLen = int(arg["beforeLen"].(float64))
+ }
+ boxID, backlinks, backmentions, linkRefsCount, mentionsCount := model.GetBacklink(id, keyword, mentionKeyword, beforeLen)
ret.Data = map[string]interface{}{
"backlinks": backlinks,
"linkRefsCount": linkRefsCount,