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: Supports rendering the row number column when exporting database https://github.com/siyuan-note/siyuan/issues/11192
Danielde7a776b652f
diff --git a/kernel/model/export.go b/kernel/model/export.goindex c86f9165b8..58c31d7aae 100644--- a/kernel/model/export.go+++ b/kernel/model/export.go@@ -119,6 +119,7 @@ func ExportAv2CSV(avID, blockID string) (zipPath string, err error) {return}+ rowNum := 1for _, row := range table.Rows {var rowVal []stringfor _, cell := range row.Cells {@@ -140,15 +141,32 @@ func ExportAv2CSV(avID, blockID string) (zipPath string, err error) {if nil != cell.Value.MAsset {buf := &bytes.Buffer{}for _, a := range cell.Value.MAsset {- buf.WriteString("- buf.WriteString(a.Content)- buf.WriteString(") ")+ if av.AssetTypeImage == a.Type {+ buf.WriteString("+ buf.WriteString(a.Content)+ buf.WriteString(") ")+ } else if av.AssetTypeFile == a.Type {+ buf.WriteString("[")+ buf.WriteString(a.Name)+ buf.WriteString("](")+ buf.WriteString(a.Content)+ buf.WriteString(") ")+ } else {+ buf.WriteString(a.Content)+ buf.WriteString(" ")+ }}val = strings.TrimSpace(buf.String())}+ } else if av.KeyTypeLineNumber == cell.Value.Type {+ val = strconv.Itoa(rowNum)}- val = cell.Value.String(true)+ if "" == val {+ val = cell.Value.String(true)+ }}rowVal = append(rowVal, val)@@ -158,6 +176,7 @@ func ExportAv2CSV(avID, blockID string) (zipPath string, err error) {f.Close()return}+ rowNum++}writer.Flush()@@ -2301,6 +2320,8 @@ func exportTree(tree *parse.Tree, wysiwyg, expandKaTexMacros, keepFold bool,cell.AppendChild(&ast.Node{Type: ast.NodeText, Tokens: []byte(col.Name)})mdTableHeadRow.AppendChild(cell)}++ rowNum := 1for _, row := range table.Rows {mdTableRow := &ast.Node{Type: ast.NodeTableRow, TableAligns: aligns}mdTable.AppendChild(mdTableRow)@@ -2325,17 +2346,33 @@ func exportTree(tree *parse.Tree, wysiwyg, expandKaTexMacros, keepFold bool,if nil != cell.Value.MAsset {buf := &bytes.Buffer{}for _, a := range cell.Value.MAsset {- buf.WriteString("- buf.WriteString(a.Content)- buf.WriteString(") ")+ if av.AssetTypeImage == a.Type {+ buf.WriteString("+ buf.WriteString(a.Content)+ buf.WriteString(") ")+ } else if av.AssetTypeFile == a.Type {+ buf.WriteString("[")+ buf.WriteString(a.Name)+ buf.WriteString("](")+ buf.WriteString(a.Content)+ buf.WriteString(") ")+ } else {+ buf.WriteString(a.Content)+ buf.WriteString(" ")+ }}val = strings.TrimSpace(buf.String())- mdTableCell.AppendChild(&ast.Node{Type: ast.NodeText, Tokens: []byte(val)})- continue}+ } else if av.KeyTypeLineNumber == cell.Value.Type {+ val = strconv.Itoa(rowNum)+ rowNum++}- val = cell.Value.String(true)+ if "" == val {+ val = cell.Value.String(true)+ }}mdTableCell.AppendChild(&ast.Node{Type: ast.NodeText, Tokens: []byte(val)})}