From c086ec4eef2dbb2929273ad8cc17acfe5a855470 Mon Sep 17 00:00:00 2001 From: Daniel <845765@qq.com> Date: Fri, 15 Nov 2024 23:29:24 +0800 Subject: [PATCH] :art: Improve escaping https://github.com/siyuan-note/siyuan/issues/13135 --- kernel/model/path.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/kernel/model/path.go b/kernel/model/path.go index 7979ce4b4..2a1068554 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,