Merge remote-tracking branch 'origin/dev' into dev

This commit is contained in:
Vanessa 2025-01-12 11:32:43 +08:00
commit 55538e8b1a
4 changed files with 12 additions and 6 deletions

View file

@ -178,7 +178,7 @@ ${checkUpdateHTML}
<span class="fn__space"></span>
<input class="b3-text-field fn__flex-center fn__size200" id="token" value="${window.siyuan.config.api.token}">
</div>
<div class="b3-label${(window.siyuan.config.system.container === "std" || window.siyuan.config.system.container === "docker") ? "" : " fn__none"}">
<div class="b3-label">
${window.siyuan.languages.networkProxy}
<div class="b3-label__text">
${window.siyuan.languages.about17}

View file

@ -1114,6 +1114,14 @@ func getDoc(c *gin.Context) {
if nil != isBacklinkArg {
isBacklink = isBacklinkArg.(bool)
}
originalRefBlockIDsArg := arg["originalRefBlockIDs"]
originalRefBlockIDs := map[string]string{}
if nil != originalRefBlockIDsArg {
m := originalRefBlockIDsArg.(map[string]interface{})
for k, v := range m {
originalRefBlockIDs[k] = v.(string)
}
}
highlightArg := arg["highlight"]
highlight := true
if nil != highlightArg {
@ -1121,7 +1129,7 @@ func getDoc(c *gin.Context) {
}
blockCount, content, parentID, parent2ID, rootID, typ, eof, scroll, boxID, docPath, isBacklinkExpand, keywords, err :=
model.GetDoc(startID, endID, id, index, query, queryTypes, queryMethod, mode, size, isBacklink, highlight)
model.GetDoc(startID, endID, id, index, query, queryTypes, queryMethod, mode, size, isBacklink, originalRefBlockIDs, highlight)
if model.ErrBlockNotFound == err {
ret.Code = 3
return

View file

@ -269,7 +269,7 @@ func Export2Liandi(id string) (err error) {
title := path.Base(tree.HPath)
tags := tree.Root.IALAttr("tags")
content := exportMarkdownContent0(tree, util.GetCloudForumAssetsServer()+time.Now().Format("2006/01")+"/siyuan/"+Conf.GetUser().UserId+"/", true,
".md", 4, 1, 0,
".md", 4, Conf.Export.BlockEmbedMode, Conf.Export.FileAnnotationRefMode,
"#", "#",
"", "",
false, nil, true, &map[string]*parse.Tree{})

View file

@ -441,7 +441,7 @@ func ListDocTree(boxID, listPath string, sortMode int, flashcard, showHidden boo
return
}
func GetDoc(startID, endID, id string, index int, query string, queryTypes map[string]bool, queryMethod, mode int, size int, isBacklink, highlight bool) (
func GetDoc(startID, endID, id string, index int, query string, queryTypes map[string]bool, queryMethod, mode int, size int, isBacklink bool, originalRefBlockIDs map[string]string, highlight bool) (
blockCount int, dom, parentID, parent2ID, rootID, typ string, eof, scroll bool, boxID, docPath string, isBacklinkExpand bool, keywords []string, err error) {
//os.MkdirAll("pprof", 0755)
//cpuProfile, _ := os.Create("pprof/GetDoc")
@ -603,8 +603,6 @@ func GetDoc(startID, endID, id string, index int, query string, queryTypes map[s
var nodes []*ast.Node
if isBacklink {
// 引用计数浮窗请求,需要按照反链逻辑组装 https://github.com/siyuan-note/siyuan/issues/6853
originalRefBlockIDs := map[string]string{}
// TODO 需要增加参数,使用 getRefIDs 返回的 originalRefBlockIDs 增加这个参数后才能支持计数浮窗内计算折叠状态 https://github.com/siyuan-note/siyuan/issues/13776
nodes, isBacklinkExpand = getBacklinkRenderNodes(node, originalRefBlockIDs)
} else {
// 如果同时存在 startID 和 endID并且是动态加载的情况则只加载 startID 和 endID 之间的块 [startID, endID]