From d5aa5d8e82718dc4fb2640547c99452e8568890c Mon Sep 17 00:00:00 2001 From: Daniel <845765@qq.com> Date: Thu, 5 Jun 2025 17:18:50 +0800 Subject: [PATCH 1/2] :art: Clean code --- kernel/av/table.go | 21 ++++++++++++--------- 1 file changed, 12 insertions(+), 9 deletions(-) diff --git a/kernel/av/table.go b/kernel/av/table.go index d0875faa3..55e417ab6 100644 --- a/kernel/av/table.go +++ b/kernel/av/table.go @@ -32,6 +32,7 @@ type LayoutTable struct { PageSize int `json:"pageSize"` // 每页行数 } +// ViewTableColumn 描述了表格列的结构。 type ViewTableColumn struct { ID string `json:"id"` // 列 ID @@ -80,17 +81,19 @@ type TableColumn struct { Date *Date `json:"date,omitempty"` // 日期设置 } -type TableCell struct { - ID string `json:"id"` - Value *Value `json:"value"` - ValueType KeyType `json:"valueType"` - Color string `json:"color"` - BgColor string `json:"bgColor"` +// TableRow 描述了表格行的结构。 +type TableRow struct { + ID string `json:"id"` // 行 ID + Cells []*TableCell `json:"cells"` // 行单元格 } -type TableRow struct { - ID string `json:"id"` - Cells []*TableCell `json:"cells"` +// TableCell 描述了表格单元格的结构。 +type TableCell struct { + ID string `json:"id"` // 单元格 ID + Value *Value `json:"value"` // 单元格值 + ValueType KeyType `json:"valueType"` // 单元格值类型 + Color string `json:"color"` // 单元格颜色 + BgColor string `json:"bgColor"` // 单元格背景颜色 } func (row *TableRow) GetBlockValue() (ret *Value) { From d143296536eb9560a1c24cc30c0772b801a29f96 Mon Sep 17 00:00:00 2001 From: Daniel <845765@qq.com> Date: Thu, 5 Jun 2025 18:47:51 +0800 Subject: [PATCH 2/2] :bug: Loses text after inline codes when exporting Word/HTML https://github.com/siyuan-note/siyuan/issues/14973 --- kernel/model/export.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/kernel/model/export.go b/kernel/model/export.go index c71f9216c..d2aed988d 100644 --- a/kernel/model/export.go +++ b/kernel/model/export.go @@ -796,7 +796,7 @@ func ExportMarkdownHTML(id, savePath string, docx, merge bool) (name, dom string } else if n.IsTextMarkType("code") { if nil != n.Next && ast.NodeText == n.Next.Type { // 行级代码导出 word 之后会有多余的零宽空格 https://github.com/siyuan-note/siyuan/issues/14825 - n.Next.Tokens = bytes.TrimPrefix(n.Tokens, []byte(editor.Zwsp)) + n.Next.Tokens = bytes.TrimPrefix(n.Next.Tokens, []byte(editor.Zwsp)) } } return ast.WalkContinue