Skip to content

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

:art: Improve database text field content escaping https://github.com/siyuan-note/siyuan/issues/11255

Daniel9661dbc4b240
diff --git a/kernel/model/attribute_view.go b/kernel/model/attribute_view.go
index be14292c41..a7985513ff 100644
--- a/kernel/model/attribute_view.go
+++ b/kernel/model/attribute_view.go
@@ -1087,6 +1087,10 @@ func renderAttributeViewTable(attrView *av.AttributeView, view *av.View, query s
if nil != tableCell.Value && nil != tableCell.Value.Relation {
tableCell.Value.Relation.Contents = nil
}
+ case av.KeyTypeText: // 渲染文本列
+ if nil != tableCell.Value && nil != tableCell.Value.Text {
+ tableCell.Value.Text.Content = util.EscapeHTML(tableCell.Value.Text.Content)
+ }
}
treenode.FillAttributeViewTableCellNilValue(tableCell, rowID, col.ID)
diff --git a/kernel/treenode/node.go b/kernel/treenode/node.go
index 5fbc14ce17..fd9d5f3b7e 100644
--- a/kernel/treenode/node.go
+++ b/kernel/treenode/node.go
@@ -722,6 +722,10 @@ func renderAttributeViewTable(attrView *av.AttributeView, view *av.View) (ret *a
if nil != tableCell.Value && nil != tableCell.Value.Relation {
tableCell.Value.Relation.Contents = nil
}
+ case av.KeyTypeText: // 渲染文本列
+ if nil != tableCell.Value && nil != tableCell.Value.Text {
+ tableCell.Value.Text.Content = util.EscapeHTML(tableCell.Value.Text.Content)
+ }
}
FillAttributeViewTableCellNilValue(tableCell, rowID, col.ID)