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

This commit is contained in:
Daniel 2024-05-08 11:08:26 +08:00
parent 11d2b0dbeb
commit 9661dbc4b2
No known key found for this signature in database
GPG key ID: 86211BA83DF03017
2 changed files with 8 additions and 0 deletions

View file

@ -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)

View file

@ -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)