Skip to content

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

:art: Improve escaping https://github.com/siyuan-note/siyuan/issues/13135

Danielc086ec4eef2d
diff --git a/kernel/model/path.go b/kernel/model/path.go
index 7979ce4b48..2a10685544 100644
--- a/kernel/model/path.go
+++ b/kernel/model/path.go
@@ -152,7 +152,7 @@ func toFlatTree(blocks []*Block, baseDepth int, typ string, tree *parse.Tree) (r
treeNode := &Path{
ID: root.ID,
Box: root.Box,
- Name: path.Base(root.HPath),
+ Name: util.EscapeHTML(path.Base(root.HPath)),
NodeType: root.Type,
Type: typ,
SubType: root.SubType,
@@ -196,7 +196,7 @@ func toSubTree(blocks []*Block, keyword string) (ret []*Path) {
treeNode := &Path{
ID: root.ID,
Box: root.Box,
- Name: path.Base(root.HPath),
+ Name: util.EscapeHTML(path.Base(root.HPath)),
Type: "backlink",
NodeType: "NodeDocument",
SubType: root.SubType,