An open-source, privacy-first, self-hosted knowledge workspace where humans and AI agents work together 开源、隐私优先、自托管的知识工作空间,让人与智能体在此协作
TypeScript agentic-aiai-agentknowledge-baselocal-firstmarkdownmcpmindmapnote-takingself-hostedsiyuanworkspace
:art: Improve database exporting for asset field https://github.com/siyuan-note/siyuan/issues/12484
Daniel53d54237705e
diff --git a/kernel/model/export.go b/kernel/model/export.goindex 5048ccb304..67be1bfa8c 100644--- a/kernel/model/export.go+++ b/kernel/model/export.go@@ -2339,6 +2339,20 @@ func exportTree(tree *parse.Tree, wysiwyg, keepFold, avHiddenCol bool,if nil != cell.Value.Updated {cell.Value.Updated = av.NewFormattedValueUpdated(cell.Value.Updated.Content, 0, av.UpdatedFormatNone)}+ } else if av.KeyTypeURL == cell.Value.Type {+ if nil != cell.Value.URL {+ if "" != strings.TrimSpace(cell.Value.URL.Content) {+ link := &ast.Node{Type: ast.NodeLink}+ link.AppendChild(&ast.Node{Type: ast.NodeOpenBracket})+ link.AppendChild(&ast.Node{Type: ast.NodeLinkText, Tokens: []byte(cell.Value.URL.Content)})+ link.AppendChild(&ast.Node{Type: ast.NodeCloseBracket})+ link.AppendChild(&ast.Node{Type: ast.NodeOpenParen})+ link.AppendChild(&ast.Node{Type: ast.NodeLinkDest, Tokens: []byte(cell.Value.URL.Content)})+ link.AppendChild(&ast.Node{Type: ast.NodeCloseParen})+ mdTableCell.AppendChild(link)+ }+ continue+ }} else if av.KeyTypeMAsset == cell.Value.Type {if nil != cell.Value.MAsset {for i, a := range cell.Value.MAsset {@@ -2353,18 +2367,23 @@ func exportTree(tree *parse.Tree, wysiwyg, keepFold, avHiddenCol bool,img.AppendChild(&ast.Node{Type: ast.NodeCloseParen})mdTableCell.AppendChild(img)} else if av.AssetTypeFile == a.Type {- file := &ast.Node{Type: ast.NodeLink}- file.AppendChild(&ast.Node{Type: ast.NodeOpenBracket})linkText := strings.TrimSpace(a.Name)if "" == linkText {linkText = a.Content}- file.AppendChild(&ast.Node{Type: ast.NodeLinkText, Tokens: []byte(linkText)})- file.AppendChild(&ast.Node{Type: ast.NodeCloseBracket})- file.AppendChild(&ast.Node{Type: ast.NodeOpenParen})- file.AppendChild(&ast.Node{Type: ast.NodeLinkDest, Tokens: []byte(a.Content)})- file.AppendChild(&ast.Node{Type: ast.NodeCloseParen})- mdTableCell.AppendChild(file)++ if "" != strings.TrimSpace(a.Content) {+ file := &ast.Node{Type: ast.NodeLink}+ file.AppendChild(&ast.Node{Type: ast.NodeOpenBracket})+ file.AppendChild(&ast.Node{Type: ast.NodeLinkText, Tokens: []byte(linkText)})+ file.AppendChild(&ast.Node{Type: ast.NodeCloseBracket})+ file.AppendChild(&ast.Node{Type: ast.NodeOpenParen})+ file.AppendChild(&ast.Node{Type: ast.NodeLinkDest, Tokens: []byte(a.Content)})+ file.AppendChild(&ast.Node{Type: ast.NodeCloseParen})+ mdTableCell.AppendChild(file)+ } else {+ mdTableCell.AppendChild(&ast.Node{Type: ast.NodeText, Tokens: []byte(linkText)})+ }}if i < len(cell.Value.MAsset)-1 {mdTableCell.AppendChild(&ast.Node{Type: ast.NodeText, Tokens: []byte(" ")})