From efed9d160464448ce261a6581d62c14cc34f970d Mon Sep 17 00:00:00 2001 From: Daniel <845765@qq.com> Date: Thu, 9 Apr 2026 12:45:15 +0800 Subject: [PATCH 1/2] :art: https://github.com/siyuan-note/siyuan/issues/17409 Signed-off-by: Daniel <845765@qq.com> --- kernel/api/file.go | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/kernel/api/file.go b/kernel/api/file.go index 73db0c753..bfd15fe0d 100644 --- a/kernel/api/file.go +++ b/kernel/api/file.go @@ -485,7 +485,13 @@ func renameFile(c *gin.Context) { return } - srcPath := arg["path"].(string) + var srcPath string + if !util.ParseJsonArgs(arg, ret, + util.BindJsonArg("path", &srcPath, true, true), + ) { + return + } + srcAbsPath, err := util.GetAbsPathInWorkspace(srcPath) if err != nil { ret.Code = http.StatusForbidden @@ -532,7 +538,13 @@ func removeFile(c *gin.Context) { return } - filePath := arg["path"].(string) + var filePath string + if !util.ParseJsonArgs(arg, ret, + util.BindJsonArg("path", &filePath, true, true), + ) { + return + } + fileAbsPath, err := util.GetAbsPathInWorkspace(filePath) if err != nil { ret.Code = http.StatusForbidden From df897f5390653061a15da478a774806064db32ac Mon Sep 17 00:00:00 2001 From: Daniel <845765@qq.com> Date: Thu, 9 Apr 2026 13:28:41 +0800 Subject: [PATCH 2/2] :art: https://github.com/siyuan-note/siyuan/issues/17440 Signed-off-by: Daniel <845765@qq.com> --- kernel/sql/block.go | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/kernel/sql/block.go b/kernel/sql/block.go index 15892f8be..b5631d043 100644 --- a/kernel/sql/block.go +++ b/kernel/sql/block.go @@ -162,6 +162,17 @@ func NodeStaticContent(node *ast.Node, excludeTypes []string, includeTextMarkATi lastSpace := false ast.Walk(node, func(n *ast.Node, entering bool) ast.WalkStatus { if !entering { + if ast.NodeTable == n.Type { + caption := n.IALAttr("caption") + if "" != caption { + caption = html.UnescapeHTMLStr(caption) + if strings.Contains(caption, "caption-side:") && strings.Contains(caption, "bottom") { + caption = gulu.Str.SubStringBetween(caption, ">", "<") + buf.WriteByte(' ') + buf.WriteString(caption) + } + } + } return ast.WalkContinue } @@ -196,6 +207,17 @@ func NodeStaticContent(node *ast.Node, excludeTypes []string, includeTextMarkATi } switch n.Type { + case ast.NodeTable: + caption := n.IALAttr("caption") + if "" != caption { + caption = html.UnescapeHTMLStr(caption) + if strings.Contains(caption, "caption-side:") && strings.Contains(caption, "bottom") { + return ast.WalkContinue + } + caption = gulu.Str.SubStringBetween(caption, ">", "<") + buf.WriteString(caption) + buf.WriteByte(' ') + } case ast.NodeTableCell: // 表格块写入数据库表时在单元格之间添加空格 https://github.com/siyuan-note/siyuan/issues/7654 if 0 < buf.Len() && ' ' != buf.Bytes()[buf.Len()-1] {