Skip to content

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

:memo: Update rich table cell format and user guides https://github.com/siyuan-note/siyuan/issues/19188

Danielee265d11c66d
diff --git a/app/guide/20210808180117-6v0mkxr/20200923234011-ieuun1p/20210808180303-h361q1i/20200924093441-ft2rhps.sy b/app/guide/20210808180117-6v0mkxr/20200923234011-ieuun1p/20210808180303-h361q1i/20200924093441-ft2rhps.sy
index 79621a6858..b9a467aaea 100644
--- a/app/guide/20210808180117-6v0mkxr/20200923234011-ieuun1p/20210808180303-h361q1i/20200924093441-ft2rhps.sy
+++ b/app/guide/20210808180117-6v0mkxr/20200923234011-ieuun1p/20210808180303-h361q1i/20200924093441-ft2rhps.sy
@@ -8,7 +8,7 @@
"title": "Formatting elements",
"title-img": "background-color:#269;background-image: linear-gradient(white 2px, transparent 2px),linear-gradient(90deg, white 2px, transparent 2px),linear-gradient(rgba(255,255,255,.3) 1px, transparent 1px),linear-gradient(90deg, rgba(255,255,255,.3) 1px, transparent 1px);background-size: 100px 100px, 100px 100px, 20px 20px, 20px 20px;background-position:-2px -2px, -2px -2px, -1px -1px, -1px -1px;",
"type": "doc",
- "updated": "20260908091355"
+ "updated": "20260909090723"
},
"Children": [
{
@@ -2548,7 +2548,7 @@
"HeadingLevel": 2,
"Properties": {
"id": "20210104091509-qr9enpx",
- "updated": "20210415200941"
+ "updated": "20260909090723"
},
"Children": [
{
@@ -2576,12 +2576,12 @@
"Type": "NodeParagraph",
"Properties": {
"id": "20260908091355-rch0008",
- "updated": "20260908091355"
+ "updated": "20260909090723"
},
"Children": [
{
"Type": "NodeText",
- "Data": "Click a cell, or place the caret in it and press "
+ "Data": "Click a cell to edit it. After creating a table, type directly without clicking again. You can also place the caret in a cell and press "
},
{
"Type": "NodeTextMark",
@@ -2590,7 +2590,7 @@
},
{
"Type": "NodeText",
- "Data": " to edit. Ordinary content keeps table navigation: "
+ "Data": " to start editing. When the cell contains only one ordinary paragraph, "
},
{
"Type": "NodeTextMark",
@@ -2599,7 +2599,7 @@
},
{
"Type": "NodeText",
- "Data": " moves to the next row, "
+ "Data": " moves to the same column in the next row, or inserts a paragraph after the table when on the last row. "
},
{
"Type": "NodeTextMark",
@@ -2617,7 +2617,7 @@
},
{
"Type": "NodeText",
- "Data": " inserts a line break within the cell. Lists and code blocks use their own line-break and indentation behavior. Close suggestions, then press "
+ "Data": " inserts a line break within the cell. With headings, multiple paragraphs, or other block content, Enter edits within the cell according to the current content type. Lists and code blocks use their own line-break and indentation behavior. Close suggestions, then press "
},
{
"Type": "NodeTextMark",
@@ -2635,12 +2635,12 @@
"Type": "NodeParagraph",
"Properties": {
"id": "20260908091355-rch0009",
- "updated": "20260908091355"
+ "updated": "20260909090723"
},
"Children": [
{
"Type": "NodeText",
- "Data": "Internal paragraphs and list items have no independent block IDs. References to existing blocks, images, and inline formatting are supported; databases, superblocks, tabs, and embedded blocks are not supported. Standard Markdown exports readable inline content; HTML, PDF, and Word preserve rich formatting."
+ "Data": "Internal paragraphs and list items have no independent block IDs. References to existing blocks, images, and existing inline formatting are supported. Nested tables, databases, super blocks, tabs, callouts, query embeds, thematic breaks, executable diagrams, audio, video, widgets, HTML, and custom blocks are not supported. If pasted content contains an unsupported block, the entire paste is rejected with a message listing the unsupported types; existing content stays unchanged. Standard Markdown exports readable inline content, while HTML, PDF, and Word preserve rich text layout."
}
]
},
diff --git a/app/guide/20210808180117-6v0mkxr/20200923234011-ieuun1p/20210808180303-xaduj2o/20200924100950-9op5xi1.sy b/app/guide/20210808180117-6v0mkxr/20200923234011-ieuun1p/20210808180303-xaduj2o/20200924100950-9op5xi1.sy
index 35c807bf28..78569ce9b1 100644
--- a/app/guide/20210808180117-6v0mkxr/20200923234011-ieuun1p/20210808180303-xaduj2o/20200924100950-9op5xi1.sy
+++ b/app/guide/20210808180117-6v0mkxr/20200923234011-ieuun1p/20210808180303-xaduj2o/20200924100950-9op5xi1.sy
@@ -7,7 +7,7 @@
"id": "20200924100950-9op5xi1",
"title": "Shortcuts",
"type": "doc",
- "updated": "20260908202901"
+ "updated": "20260909090822"
},
"Children": [
{
@@ -12362,7 +12362,7 @@
"Properties": {
"colgroup": "|",
"id": "20210106154319-otreidg",
- "updated": "20260908091355"
+ "updated": "20260909090822"
},
"Children": [
{
@@ -13089,7 +13089,7 @@
"Children": [
{
"Type": "NodeText",
- "Data": "Ordinary cell content: next row; lists or code: new item or line"
+ "Data": "A single ordinary paragraph: next row in the same column, or a paragraph after the last row; other content follows its block type"
}
]
},
diff --git a/app/guide/20210808180117-czj9bvb/20200812220555-lj3enxa/20210808180320-abz7w6k/20200825162036-4dx365o.sy b/app/guide/20210808180117-czj9bvb/20200812220555-lj3enxa/20210808180320-abz7w6k/20200825162036-4dx365o.sy
index 42cfd677e2..ce2b18c20a 100644
--- a/app/guide/20210808180117-czj9bvb/20200812220555-lj3enxa/20210808180320-abz7w6k/20200825162036-4dx365o.sy
+++ b/app/guide/20210808180117-czj9bvb/20200812220555-lj3enxa/20210808180320-abz7w6k/20200825162036-4dx365o.sy
@@ -8,7 +8,7 @@
"title": "排版元素",
"title-img": "background-color: hsl(2, 57%, 40%);background-image: repeating-linear-gradient(transparent, transparent 50px, rgba(0,0,0,.4) 50px, rgba(0,0,0,.4) 53px, transparent 53px, transparent 63px, rgba(0,0,0,.4) 63px, rgba(0,0,0,.4) 66px, transparent 66px, transparent 116px, rgba(0,0,0,.5) 116px, rgba(0,0,0,.5) 166px, rgba(255,255,255,.2) 166px, rgba(255,255,255,.2) 169px, rgba(0,0,0,.5) 169px, rgba(0,0,0,.5) 179px, rgba(255,255,255,.2) 179px, rgba(255,255,255,.2) 182px, rgba(0,0,0,.5) 182px, rgba(0,0,0,.5) 232px, transparent 232px),repeating-linear-gradient(270deg, transparent, transparent 50px, rgba(0,0,0,.4) 50px, rgba(0,0,0,.4) 53px, transparent 53px, transparent 63px, rgba(0,0,0,.4) 63px, rgba(0,0,0,.4) 66px, transparent 66px, transparent 116px, rgba(0,0,0,.5) 116px, rgba(0,0,0,.5) 166px, rgba(255,255,255,.2) 166px, rgba(255,255,255,.2) 169px, rgba(0,0,0,.5) 169px, rgba(0,0,0,.5) 179px, rgba(255,255,255,.2) 179px, rgba(255,255,255,.2) 182px, rgba(0,0,0,.5) 182px, rgba(0,0,0,.5) 232px, transparent 232px),repeating-linear-gradient(125deg, transparent, transparent 2px, rgba(0,0,0,.2) 2px, rgba(0,0,0,.2) 3px, transparent 3px, transparent 5px, rgba(0,0,0,.2) 5px);",
"type": "doc",
- "updated": "20260908091355"
+ "updated": "20260909090723"
},
"Children": [
{
@@ -2540,7 +2540,7 @@
"HeadingLevel": 2,
"Properties": {
"id": "20210104091228-1bq55o9",
- "updated": "20210604183513"
+ "updated": "20260909090723"
},
"Children": [
{
@@ -2568,12 +2568,12 @@
"Type": "NodeParagraph",
"Properties": {
"id": "20260908091355-rch0005",
- "updated": "20260908091355"
+ "updated": "20260909090723"
},
"Children": [
{
"Type": "NodeText",
- "Data": "点击单元格,或将光标移入后按 "
+ "Data": "点击单元格即可编辑;新建表格后可直接输入,无需再次点击。也可以将光标移入单元格后按 "
},
{
"Type": "NodeTextMark",
@@ -2582,7 +2582,7 @@
},
{
"Type": "NodeText",
- "Data": " 开始编辑。普通内容保持表格导航:"
+ "Data": " 开始编辑。单元格仅含一个普通段落时,"
},
{
"Type": "NodeTextMark",
@@ -2591,7 +2591,7 @@
},
{
"Type": "NodeText",
- "Data": " 移到下一行,"
+ "Data": " 移到下一行同列;表格末行则在表格后插入段落。"
},
{
"Type": "NodeTextMark",
@@ -2609,7 +2609,7 @@
},
{
"Type": "NodeText",
- "Data": " 在单元格内换行。列表和代码块内使用对应的换行和缩进操作。关闭提示后按 "
+ "Data": " 在单元格内换行。包含标题、多个段落等内容时,Enter 按当前内容类型在单元格内编辑;列表和代码块使用对应的换行和缩进操作。关闭提示后按 "
},
{
"Type": "NodeTextMark",
@@ -2627,12 +2627,12 @@
"Type": "NodeParagraph",
"Properties": {
"id": "20260908091355-rch0006",
- "updated": "20260908091355"
+ "updated": "20260909090723"
},
"Children": [
{
"Type": "NodeText",
- "Data": "内部段落和列表项没有独立块 ID,支持引用已有块,不支持数据库、超级块、页签和嵌入块。图片及原有行级格式可以保留。标准 Markdown 导出为可读的行级内容,HTML、PDF 和 Word 导出保留富文本排版。"
+ "Data": "内部段落和列表项没有独立块 ID,支持引用已有块。图片及原有行级格式可以保留。不支持嵌套表格、数据库、超级块、页签、提示块、查询嵌入、分隔线、可执行图表、音视频、挂件、HTML 和自定义块。粘贴内容包含不支持的块时,会拒绝整次粘贴并提示不支持的类型,原有内容不变。标准 Markdown 导出为可读的行级内容,HTML、PDF 和 Word 导出保留富文本排版。"
}
]
},
diff --git a/app/guide/20210808180117-czj9bvb/20200812220555-lj3enxa/20210808180321-hbvl5c2/20200813004551-gm0pbn1.sy b/app/guide/20210808180117-czj9bvb/20200812220555-lj3enxa/20210808180321-hbvl5c2/20200813004551-gm0pbn1.sy
index 7f321af01f..8549a0bc14 100644
--- a/app/guide/20210808180117-czj9bvb/20200812220555-lj3enxa/20210808180321-hbvl5c2/20200813004551-gm0pbn1.sy
+++ b/app/guide/20210808180117-czj9bvb/20200812220555-lj3enxa/20210808180321-hbvl5c2/20200813004551-gm0pbn1.sy
@@ -7,7 +7,7 @@
"id": "20200813004551-gm0pbn1",
"title": "快捷键",
"type": "doc",
- "updated": "20260908202901"
+ "updated": "20260909090822"
},
"Children": [
{
@@ -12348,7 +12348,7 @@
"Properties": {
"colgroup": "|",
"id": "20201227133317-v7clw0j",
- "updated": "20260908091355"
+ "updated": "20260909090822"
},
"Children": [
{
@@ -13075,7 +13075,7 @@
"Children": [
{
"Type": "NodeText",
- "Data": "单元格普通内容:下一行;列表或代码:新列表项或换行"
+ "Data": "单元格仅含一个普通段落:移到下一行同列,末行则在表格后插入段落;其他内容按当前类型编辑"
}
]
},
diff --git a/app/guide/20211226090932-5lcq56f/20211226115423-d5z1joq/20211226120854-dr1jfx2/20211226121319-emrk2yy.sy b/app/guide/20211226090932-5lcq56f/20211226115423-d5z1joq/20211226120854-dr1jfx2/20211226121319-emrk2yy.sy
index 25d7115bb6..793ea4cc28 100644
--- a/app/guide/20211226090932-5lcq56f/20211226115423-d5z1joq/20211226120854-dr1jfx2/20211226121319-emrk2yy.sy
+++ b/app/guide/20211226090932-5lcq56f/20211226115423-d5z1joq/20211226120854-dr1jfx2/20211226121319-emrk2yy.sy
@@ -8,7 +8,7 @@
"title": "排版元素",
"title-img": "background-color: hsl(2, 57%, 40%);background-image: repeating-linear-gradient(transparent, transparent 50px, rgba(0,0,0,.4) 50px, rgba(0,0,0,.4) 53px, transparent 53px, transparent 63px, rgba(0,0,0,.4) 63px, rgba(0,0,0,.4) 66px, transparent 66px, transparent 116px, rgba(0,0,0,.5) 116px, rgba(0,0,0,.5) 166px, rgba(255,255,255,.2) 166px, rgba(255,255,255,.2) 169px, rgba(0,0,0,.5) 169px, rgba(0,0,0,.5) 179px, rgba(255,255,255,.2) 179px, rgba(255,255,255,.2) 182px, rgba(0,0,0,.5) 182px, rgba(0,0,0,.5) 232px, transparent 232px),repeating-linear-gradient(270deg, transparent, transparent 50px, rgba(0,0,0,.4) 50px, rgba(0,0,0,.4) 53px, transparent 53px, transparent 63px, rgba(0,0,0,.4) 63px, rgba(0,0,0,.4) 66px, transparent 66px, transparent 116px, rgba(0,0,0,.5) 116px, rgba(0,0,0,.5) 166px, rgba(255,255,255,.2) 166px, rgba(255,255,255,.2) 169px, rgba(0,0,0,.5) 169px, rgba(0,0,0,.5) 179px, rgba(255,255,255,.2) 179px, rgba(255,255,255,.2) 182px, rgba(0,0,0,.5) 182px, rgba(0,0,0,.5) 232px, transparent 232px),repeating-linear-gradient(125deg, transparent, transparent 2px, rgba(0,0,0,.2) 2px, rgba(0,0,0,.2) 3px, transparent 3px, transparent 5px, rgba(0,0,0,.2) 5px);",
"type": "doc",
- "updated": "20260908091355"
+ "updated": "20260909090723"
},
"Children": [
{
@@ -2538,7 +2538,7 @@
"HeadingLevel": 2,
"Properties": {
"id": "20211226122008-8glkpvq",
- "updated": "20211226122008"
+ "updated": "20260909090723"
},
"Children": [
{
@@ -2566,12 +2566,12 @@
"Type": "NodeParagraph",
"Properties": {
"id": "20260908091355-rch0002",
- "updated": "20260908091355"
+ "updated": "20260909090723"
},
"Children": [
{
"Type": "NodeText",
- "Data": "點擊儲存格,或將游標移入後按 "
+ "Data": "點擊儲存格即可編輯;新增表格後可直接輸入,無需再次點擊。也可以將游標移入儲存格後按 "
},
{
"Type": "NodeTextMark",
@@ -2580,7 +2580,7 @@
},
{
"Type": "NodeText",
- "Data": " 開始編輯。一般內容維持表格導覽:"
+ "Data": " 開始編輯。儲存格僅含一個普通段落時,"
},
{
"Type": "NodeTextMark",
@@ -2589,7 +2589,7 @@
},
{
"Type": "NodeText",
- "Data": " 移到下一列,"
+ "Data": " 移到下一列的同欄;表格末列則在表格後插入段落。"
},
{
"Type": "NodeTextMark",
@@ -2607,7 +2607,7 @@
},
{
"Type": "NodeText",
- "Data": " 在儲存格內換行。列表和程式碼區塊內使用對應的換行與縮排操作。關閉提示後按 "
+ "Data": " 在儲存格內換行。包含標題、多個段落等內容時,Enter 依目前內容類型在儲存格內編輯;列表和程式碼區塊使用對應的換行與縮排操作。關閉提示後按 "
},
{
"Type": "NodeTextMark",
@@ -2625,12 +2625,12 @@
"Type": "NodeParagraph",
"Properties": {
"id": "20260908091355-rch0003",
- "updated": "20260908091355"
+ "updated": "20260909090723"
},
"Children": [
{
"Type": "NodeText",
- "Data": "內部段落和清單項目沒有獨立區塊 ID,支援引用既有區塊,不支援資料庫、超級區塊、頁籤和嵌入區塊。圖片及既有行內格式可以保留。標準 Markdown 匯出為可讀的行內內容,HTML、PDF 和 Word 匯出保留富文字排版。"
+ "Data": "內部段落和列表項目沒有獨立區塊 ID,支援引用既有區塊。圖片及原有行級格式可以保留。不支援巢狀表格、資料庫、超級區塊、頁籤、提示區塊、查詢嵌入、分隔線、可執行圖表、音訊、影片、掛件、HTML 和自訂區塊。貼上內容包含不支援的區塊時,會拒絕整次貼上並提示不支援的類型,原有內容不變。標準 Markdown 匯出為可讀的行級內容,HTML、PDF 和 Word 匯出保留富文字排版。"
}
]
},
diff --git a/app/guide/20211226090932-5lcq56f/20211226115423-d5z1joq/20211226121203-rjjngpz/20211226122549-jktxego.sy b/app/guide/20211226090932-5lcq56f/20211226115423-d5z1joq/20211226121203-rjjngpz/20211226122549-jktxego.sy
index 9fbb2a06c6..471f0f7a1b 100644
--- a/app/guide/20211226090932-5lcq56f/20211226115423-d5z1joq/20211226121203-rjjngpz/20211226122549-jktxego.sy
+++ b/app/guide/20211226090932-5lcq56f/20211226115423-d5z1joq/20211226121203-rjjngpz/20211226122549-jktxego.sy
@@ -7,7 +7,7 @@
"id": "20211226122549-jktxego",
"title": "快捷鍵",
"type": "doc",
- "updated": "20260908202901"
+ "updated": "20260909090822"
},
"Children": [
{
@@ -12354,7 +12354,7 @@
"Properties": {
"colgroup": "|",
"id": "20211226122652-n2r88dm",
- "updated": "20260908091355"
+ "updated": "20260909090822"
},
"Children": [
{
@@ -13081,7 +13081,7 @@
"Children": [
{
"Type": "NodeText",
- "Data": "儲存格一般內容:下一列;列表或程式碼:新項目或換行"
+ "Data": "儲存格僅含一個普通段落:移到下一列的同欄,末列則在表格後插入段落;其他內容依目前類型編輯"
}
]
},
diff --git a/app/guide/20240530133126-axarxgx/20240530101000-4qitucx/20240530101000-hnu6o79/20240530101000-3qhz7br.sy b/app/guide/20240530133126-axarxgx/20240530101000-4qitucx/20240530101000-hnu6o79/20240530101000-3qhz7br.sy
index 4048dfd197..89fe495604 100644
--- a/app/guide/20240530133126-axarxgx/20240530101000-4qitucx/20240530101000-hnu6o79/20240530101000-3qhz7br.sy
+++ b/app/guide/20240530133126-axarxgx/20240530101000-4qitucx/20240530101000-hnu6o79/20240530101000-3qhz7br.sy
@@ -9,7 +9,7 @@
"title": "書式要素",
"title-img": "background-color:#269;background-image: linear-gradient(white 2px, transparent 2px),linear-gradient(90deg, white 2px, transparent 2px),linear-gradient(rgba(255,255,255,.3) 1px, transparent 1px),linear-gradient(90deg, rgba(255,255,255,.3) 1px, transparent 1px);background-size: 100px 100px, 100px 100px, 20px 20px, 20px 20px;background-position:-2px -2px, -2px -2px, -1px -1px, -1px -1px;",
"type": "doc",
- "updated": "20260905124213"
+ "updated": "20260909090723"
},
"Children": [
{
@@ -2704,7 +2704,7 @@
"Properties": {
"ID": "20240530101000-grqaq7u",
"id": "20240530101000-hen4g1y",
- "updated": "20240530101000"
+ "updated": "20260909090723"
},
"Children": [
{
@@ -2713,6 +2713,93 @@
}
]
},
+ {
+ "ID": "20260909090723-b3zszao",
+ "Type": "NodeParagraph",
+ "Properties": {
+ "id": "20260909090723-b3zszao",
+ "updated": "20260909090723"
+ },
+ "Children": [
+ {
+ "Type": "NodeText",
+ "Data": "セルは手動で変換せずに段落、見出し、リスト、引用、コード、数式を編集できます。既存の文字列に含まれる Markdown 記号はそのまま保持されます。"
+ }
+ ]
+ },
+ {
+ "ID": "20260909090723-or0hf4r",
+ "Type": "NodeParagraph",
+ "Properties": {
+ "id": "20260909090723-or0hf4r",
+ "updated": "20260909090723"
+ },
+ "Children": [
+ {
+ "Type": "NodeText",
+ "Data": "セルをクリックすると編集できます。テーブルの作成直後は、再度クリックせずに入力できます。セルにカーソルを移動して "
+ },
+ {
+ "Type": "NodeTextMark",
+ "TextMarkType": "kbd",
+ "TextMarkTextContent": "F2"
+ },
+ {
+ "Type": "NodeText",
+ "Data": " を押しても編集を開始できます。セルに通常の段落が一つだけ含まれる場合、"
+ },
+ {
+ "Type": "NodeTextMark",
+ "TextMarkType": "kbd",
+ "TextMarkTextContent": "Enter"
+ },
+ {
+ "Type": "NodeText",
+ "Data": " で次の行の同じ列に移動します。最終行ではテーブルの後に段落を挿入します。"
+ },
+ {
+ "Type": "NodeTextMark",
+ "TextMarkType": "kbd",
+ "TextMarkTextContent": "Tab"
+ },
+ {
+ "Type": "NodeText",
+ "Data": " でセルを切り替え、"
+ },
+ {
+ "Type": "NodeTextMark",
+ "TextMarkType": "kbd",
+ "TextMarkTextContent": "Shift+Enter"
+ },
+ {
+ "Type": "NodeText",
+ "Data": " でセル内を改行します。見出しや複数の段落などを含む場合、Enter は現在の内容の種類に応じてセル内を編集します。リストとコードブロックでは、それぞれの改行とインデント操作が適用されます。候補を閉じてから "
+ },
+ {
+ "Type": "NodeTextMark",
+ "TextMarkType": "kbd",
+ "TextMarkTextContent": "Escape"
+ },
+ {
+ "Type": "NodeText",
+ "Data": " を押すか、セルの外をクリックすると編集が終了し、内容が自動保存されます。"
+ }
+ ]
+ },
+ {
+ "ID": "20260909090723-xl7wtk2",
+ "Type": "NodeParagraph",
+ "Properties": {
+ "id": "20260909090723-xl7wtk2",
+ "updated": "20260909090723"
+ },
+ "Children": [
+ {
+ "Type": "NodeText",
+ "Data": "内部の段落とリスト項目に独立したブロック ID はありません。既存のブロックへの参照、画像、既存のインライン書式に対応しています。入れ子のテーブル、データベース、スーパーブロック、タブ、コールアウト、クエリ埋め込み、区切り線、実行可能な図表、音声、動画、ウィジェット、HTML、カスタムブロックには対応していません。貼り付ける内容に未対応のブロックが含まれる場合は、貼り付け全体を拒否して未対応の種類を通知し、既存の内容を維持します。標準 Markdown では読みやすいインライン内容としてエクスポートされ、HTML、PDF、Word ではリッチテキストのレイアウトが保持されます。"
+ }
+ ]
+ },
{
"ID": "20240530101000-ljffdgf",
"Type": "NodeTable",
diff --git a/docs/SY-FORMAT.md b/docs/SY-FORMAT.md
index c7b0f900f5..c88cd50462 100644
--- a/docs/SY-FORMAT.md
+++ b/docs/SY-FORMAT.md
@@ -69,7 +69,7 @@ Division of labor among the four paths:
| Top-level key | Required | Meaning |
|---|---|---|
| `ID` | ✅ | Document block ID. **Equals the filename without `.sy`** |
-| `Spec` | ✅ | `"2"` for ordinary documents, `"3"` for tabs documents; older or missing values are compatible input and may be upgraded |
+| `Spec` | ✅ | `"2"` for ordinary documents, `"3"` for tabs documents, `"4"` for documents using table-cell rich text; older or missing values are compatible input and may be upgraded |
| `Type` | ✅ | `"NodeDocument"` |
| `Properties` | ✅ | Document-level IAL — see §8 |
| `Children` | ✅ | Array of body child blocks; canonical files contain at least one block |
@@ -340,7 +340,7 @@ The table lists the five built-in types and their defaults. Custom `CalloutType`
`NodeTabItem.Properties["tabs-task"]` optionally preserves the original task-list marker. Absence means an ordinary tab, one ASCII space means incomplete, and other supported single-character task markers (including `X`, `/`, and `?`) retain their exact values. Task status is independent of title content and active-tab selection. Markdown export preserves it as an item IAL immediately after the `@tab` title line, for example `{: tabs-task="/"}`. Attribute values must use the same escaping as other IAL values. Conversion back to a task list restores the current marker; conversion to an ordinary list removes the task attribute.
-Documents containing either node require `Spec: "3"`; ordinary documents remain on Spec 2. Keep Spec 3 after removing the feature. Check the raw root `Spec` before passing JSON to a tolerant parser, because unknown node types can otherwise lose their children. Unsupported versions must not be repaired and written back.
+Documents containing either node require at least `Spec: "3"`; documents using table-cell rich text use Spec 4. Ordinary documents remain on Spec 2. Never lower the version after removing a feature. Check the raw root `Spec` before passing JSON to a tolerant parser, because unknown node types can otherwise lose their children. Unsupported versions must not be repaired and written back.
The internal Markdown syntax uses `::: tabs` to open a group and `@tab <inline title>` to start each item; `@tab:active <inline title>` identifies the selected item. The opening fence requires at least three colons and whitespace (spaces or tabs) before `tabs`; canonical output uses one space. Items have no closing marker; the group closes with a standalone fence containing the same number of colons as its opening fence. Outer fences must be longer than nested fences. Indentation is optional, and canonical output computes fence lengths from nesting depth without adding indentation to tab bodies. Old `:::tabs` and `:::tab` syntax is not recognized; existing `.sy` tab nodes retain the same structure.
@@ -634,7 +634,7 @@ Canonical writers must not generate the following syntax or node families. Most
When generating or compatibly editing a `.sy` that SiYuan can load cleanly, verify item by item:
-1. ☐ Root `Type` = `"NodeDocument"`, `Spec` = `"2"` or `"3"` (tabs documents); root `ID` = filename (without `.sy`) and equals `Properties.id`
+1. ☐ Root `Type` = `"NodeDocument"`, `Spec` = `"2"`, `"3"` (tabs), or `"4"` (table-cell rich text), without lowering an existing version; root `ID` = filename (without `.sy`) and equals `Properties.id`
2. ☐ Root `Properties` contains `id`/`title`/`type:"doc"`/`updated`
3. ☐ Every newly generated ID is fresh and workspace-wide unique; every canonical block has a 22-char `ID`, matching `Properties.id`, and a valid 14-digit `Properties.updated`
4. ☐ Determine block status from `Type`, not from `ID`; do not add IDs to new inline/marker nodes, and only remove historical non-block IDs as field normalization without deleting the node
diff --git a/docs/SY-FORMAT.zh-CN.md b/docs/SY-FORMAT.zh-CN.md
index 3bac0e902c..5f16c98779 100644
--- a/docs/SY-FORMAT.zh-CN.md
+++ b/docs/SY-FORMAT.zh-CN.md
@@ -1,6 +1,6 @@
# SiYuan `.sy` 文件 JSON 结构规范 —— AI 读写指南
-> 规范写入基准:普通文档为 Spec `2`,包含页签的文档为 Spec `3`;兼容读取器可以升级旧版或缺少 `Spec` 的数据。
+> 规范写入基准:普通文档为 Spec `2`,包含页签的文档为 Spec `3`,使用表格单元格富文本的文档为 Spec `4`;兼容读取器可以升级旧版或缺少 `Spec` 的数据。
> 核验样本:`20200825162036-4dx365o.sy`(排版元素)、`20200905090211-2vixtlf.sy`(内容块类型)。
> 本文档所有结论均基于真实样本及当前 Lute / 思源内核源码核验。上述样本包含少量已知的历史遗留数据;样本与当前源码不一致时,规范写入规则以当前源码为准。
> 本指南描述普通笔记本中的明文 `.sy` JSON,或已解锁加密笔记本的解密后 AST。加密笔记本磁盘上的 `.sy` 文件是密文,不能当作 JSON 直接编辑。
@@ -69,7 +69,7 @@
| 顶层键 | 必有 | 说明 |
|---|---|---|
| `ID` | ✅ | 文档块 ID,**等于去掉 `.sy` 后的文件名** |
-| `Spec` | ✅ | 普通文档为 `"2"`,页签文档为 `"3"`;旧值或缺失值属于兼容输入,可以升级 |
+| `Spec` | ✅ | 普通文档为 `"2"`,页签文档为 `"3"`,使用表格单元格富文本的文档为 `"4"`;旧值或缺失值属于兼容输入,可以升级 |
| `Type` | ✅ | `"NodeDocument"` |
| `Properties` | ✅ | 文档级 IAL,见 §8 |
| `Children` | ✅ | 正文子块数组;规范文件至少包含一个块 |
@@ -338,7 +338,7 @@ NodeList NodeList
`TabItemTitle` 是可省略的行级 Markdown,使用与 `CalloutTitle` 相同的行级文本标记表示,不作为独立子块持久化。允许空标题和重名。子节点数组决定顺序。`tabs-active-id` 指向直属页签项 ID,缺失或失效时回退到第一页。`tabs-position` 仅接受 `top`(默认)和 `left`。两项属性均保存并同步,仅切换选中项不改变正文修改时间。重建块 ID 时,也必须映射选中项 ID 及标题中的内部引用。
-包含这两类节点的文档必须使用 `Spec: "3"`,普通文档保持 Spec 2。移除页签后不自动降级。向容错解析器传递 JSON 之前,先读取根的原始 `Spec`,避免未知节点的子内容被清空;不得修复并写回不支持的版本。
+包含这两类节点的文档必须至少使用 `Spec: "3"`;使用表格单元格富文本的文档为 Spec 4,普通文档保持 Spec 2。移除功能后不降低版本。向容错解析器传递 JSON 之前,先读取根的原始 `Spec`,避免未知节点的子内容被清空;不得修复并写回不支持的版本。
内部 Markdown 使用 `::: tabs` 开始一组页签,`@tab <行级标题>` 开始一个页签项,`@tab:active <行级标题>` 标识选中项。开始围栏至少包含三个冒号,冒号与 `tabs` 之间需要空格或制表符,规范输出使用一个空格。页签项没有单独的结束标记;整组以独占一行、与开始围栏冒号数量相同的结束围栏闭合。外层围栏必须比内层长,缩进可选;规范输出根据嵌套深度计算围栏长度,不额外缩进页签正文。旧的 `:::tabs`、`:::tab` 语法不再识别,既有 `.sy` 页签节点结构保持不变。
@@ -413,6 +413,12 @@ NodeList NodeList
- 表格可选的 `Properties.caption` 保存标题 HTML。
- `NodeTableCell` 可使用 `Properties.colspan`、`Properties.rowspan` 和 `Properties.style` 保存合并单元格及单元格样式状态。
+含有富文本块内容的单元格额外携带 `"TableCellRich": {"spec": 1, "format": "kramdown", "content": "- first\n- second"}`。该源内容是权威数据;`Children` 仍是包含可读列表标记和换行的内联投影。内部段落、列表、代码和公式不会成为文档块,也没有持久化块 ID。图片、对已有块的引用及支持的行级格式保留在投影中,用于索引和资源处理。富文本表格保留 `Properties.custom-sy-table-rich = "1"`;即使所有富文本单元格只剩行级内容或为空,BlockDOM 更新也必须保留此标记,防止遗漏源内容的写入器静默替换富文本表格。
+
+片段内部只支持段落、标题、列表、引述、普通代码和公式。不支持嵌套表格、数据库、超级块、页签、提示块、查询嵌入、可执行图表、媒体、挂件和 HTML 块。BlockDOM 将源内容封装为 UTF-8 JSON,使用无填充的 URL 安全 Base64 编码,保存在单元格的 `data-sy-table-cell-rich` 属性中。内部 Kramdown 使用对应的 `table-cell-rich` 单元格 IAL;这两种表示都不是标准 Markdown 交换格式。
+
+读取器先校验源内容版本和内容,再重建投影。封装字段缺失、为 null、未知或格式错误时必须报错,不支持的输入必须保持原样。普通单元格没有此封装,不能将其中的文字重新解释为 Markdown。仅打开单元格或编辑普通行级内容时保留现有表示。首次添加块内容时创建富文本封装,并将文档 `Spec` 提升到 `4`。已有富文本封装在内容变为纯行级或空内容后仍保留,文档版本不降低。标准 Markdown 导出使用可读的内联投影;HTML、PDF 和 Word 导出仅在临时导出树中展开片段。加密笔记本在解析同一 JSON 之前,先认证现有文档加密封装;密钥派生、AAD 和恢复材料均不改变。
+
### 5.14 数据库块(AttributeView,叶子)
```json
@@ -627,7 +633,7 @@ NodeList NodeList
生成或兼容编辑一份能被思源正常加载的 `.sy` 时,应逐条核对:
-1. ☐ 根 `Type` = `"NodeDocument"`、`Spec` = `"2"` 或 `"3"`(页签文档);根 `ID` 等于去掉 `.sy` 后的文件名,并等于 `Properties.id`
+1. ☐ 根 `Type` = `"NodeDocument"`、`Spec` = `"2"`、`"3"`(页签)或 `"4"`(表格单元格富文本),且不降低已有版本;根 `ID` 等于去掉 `.sy` 后的文件名,并等于 `Properties.id`
2. ☐ 根 `Properties` 包含 `id` / `title` / `type:"doc"` / `updated`
3. ☐ 每个新生成的 ID 都是新值且在整个工作区中唯一;每个规范块都有 22 字符 `ID`、与之匹配的 `Properties.id`,以及合法的 14 位 `Properties.updated`
4. ☐ 根据 `Type` 而不是 `ID` 判断块;不要为新内联或标记节点添加 ID,只能将历史非块 ID 作为字段规范化清理,不能删除节点本身