Skip to content

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

:recycle: Migrate legacy mind maps to list views and stabilize interactions https://github.com/siyuan-note/siyuan/issues/19677

Vanessadf8fac7dc1eb
diff --git a/app/appearance/langs/ar.json b/app/appearance/langs/ar.json
index 3cf37ed4ac..542fecc2a7 100644
--- a/app/appearance/langs/ar.json
+++ b/app/appearance/langs/ar.json
@@ -1,4 +1,5 @@
{
+ "listMindmapMigrationInvalid": "تعذر تحويل الخريطة الذهنية بالكامل إلى قائمة؛ تم الاحتفاظ بالنص الأصلي",
"listMindmapRouteStart": "اسحب لتغيير عقدة البداية",
"listMindmapRouteEnd": "اسحب لتغيير عقدة النهاية",
"listMindmapRouteHandle": "اسحب لضبط المسار؛ انقر نقرًا مزدوجًا على مقبض السحب لاستعادة الحساب التلقائي",
diff --git a/app/appearance/langs/de.json b/app/appearance/langs/de.json
index e5a6301942..12506a52ca 100644
--- a/app/appearance/langs/de.json
+++ b/app/appearance/langs/de.json
@@ -1,4 +1,5 @@
{
+ "listMindmapMigrationInvalid": "Die Mindmap konnte nicht vollständig in eine Liste umgewandelt werden; der Quelltext bleibt erhalten",
"listMindmapRouteStart": "Ziehen, um den Startknoten zu ändern",
"listMindmapRouteEnd": "Ziehen, um den Zielknoten zu ändern",
"listMindmapRouteHandle": "Ziehen, um den Verlauf anzupassen; Doppelklick auf den Ziehpunkt stellt die automatische Berechnung wieder her",
diff --git a/app/appearance/langs/en.json b/app/appearance/langs/en.json
index bff30bdf06..f19dfc3de1 100644
--- a/app/appearance/langs/en.json
+++ b/app/appearance/langs/en.json
@@ -1,4 +1,5 @@
{
+ "listMindmapMigrationInvalid": "This mind map could not be fully converted to a list; the original source is preserved",
"listMindmapRouteStart": "Drag to change the start node",
"listMindmapRouteEnd": "Drag to change the end node",
"listMindmapRouteHandle": "Drag to adjust the path; double-click the handle to reset",
diff --git a/app/appearance/langs/es.json b/app/appearance/langs/es.json
index a60a125c5c..64eb89c048 100644
--- a/app/appearance/langs/es.json
+++ b/app/appearance/langs/es.json
@@ -1,4 +1,5 @@
{
+ "listMindmapMigrationInvalid": "Este mapa mental no se pudo convertir por completo en una lista; se conserva el texto original",
"listMindmapRouteStart": "Arrastra para cambiar el nodo inicial",
"listMindmapRouteEnd": "Arrastra para cambiar el nodo final",
"listMindmapRouteHandle": "Arrastra para ajustar el trazado; haz doble clic en el controlador para restablecerlo",
diff --git a/app/appearance/langs/fr.json b/app/appearance/langs/fr.json
index 615c91c427..75cf2a0368 100644
--- a/app/appearance/langs/fr.json
+++ b/app/appearance/langs/fr.json
@@ -1,4 +1,5 @@
{
+ "listMindmapMigrationInvalid": "Cette carte mentale ne peut pas être entièrement convertie en liste ; le texte source est conservé",
"listMindmapRouteStart": "Faites glisser pour changer le nœud de départ",
"listMindmapRouteEnd": "Faites glisser pour changer le nœud d’arrivée",
"listMindmapRouteHandle": "Faites glisser pour ajuster le tracé ; double-cliquez sur la poignée pour rétablir le calcul automatique",
diff --git a/app/appearance/langs/he.json b/app/appearance/langs/he.json
index 97546c17bf..79df5a4aab 100644
--- a/app/appearance/langs/he.json
+++ b/app/appearance/langs/he.json
@@ -1,4 +1,5 @@
{
+ "listMindmapMigrationInvalid": "לא ניתן להמיר את מפת החשיבה במלואה לרשימה; טקסט המקור נשמר",
"listMindmapRouteStart": "גררו כדי לשנות את צומת ההתחלה",
"listMindmapRouteEnd": "גררו כדי לשנות את צומת הסיום",
"listMindmapRouteHandle": "גררו כדי להתאים את הנתיב; לחצו פעמיים על ידית הגרירה כדי לשחזר חישוב אוטומטי",
diff --git a/app/appearance/langs/hi.json b/app/appearance/langs/hi.json
index a51591ab22..d16bea2cfa 100644
--- a/app/appearance/langs/hi.json
+++ b/app/appearance/langs/hi.json
@@ -1,4 +1,5 @@
{
+ "listMindmapMigrationInvalid": "इस माइंड मैप को पूरी तरह सूची में नहीं बदला जा सका; मूल पाठ सुरक्षित है",
"listMindmapRouteStart": "आरंभिक नोड बदलने के लिए खींचें",
"listMindmapRouteEnd": "लक्ष्य नोड बदलने के लिए खींचें",
"listMindmapRouteHandle": "पथ समायोजित करने के लिए खींचें; स्वचालित गणना बहाल करने के लिए ड्रैग हैंडल पर दो बार क्लिक करें",
diff --git a/app/appearance/langs/id.json b/app/appearance/langs/id.json
index 6e42acbc24..e98b44336b 100644
--- a/app/appearance/langs/id.json
+++ b/app/appearance/langs/id.json
@@ -1,4 +1,5 @@
{
+ "listMindmapMigrationInvalid": "Peta pikiran ini tidak dapat sepenuhnya dikonversi menjadi daftar; teks sumber asli tetap disimpan",
"listMindmapRouteStart": "Seret untuk mengganti simpul awal",
"listMindmapRouteEnd": "Seret untuk mengganti simpul tujuan",
"listMindmapRouteHandle": "Seret untuk menyesuaikan jalur; klik dua kali pada pegangan seret untuk mengembalikan perhitungan otomatis",
diff --git a/app/appearance/langs/it.json b/app/appearance/langs/it.json
index 5df5a4726f..e59d0a4142 100644
--- a/app/appearance/langs/it.json
+++ b/app/appearance/langs/it.json
@@ -1,4 +1,5 @@
{
+ "listMindmapMigrationInvalid": "Questa mappa mentale non può essere convertita interamente in un elenco; il testo originale viene conservato",
"listMindmapRouteStart": "Trascina per cambiare il nodo iniziale",
"listMindmapRouteEnd": "Trascina per cambiare il nodo di destinazione",
"listMindmapRouteHandle": "Trascina per regolare il percorso; fai doppio clic sulla maniglia per ripristinare il calcolo automatico",
diff --git a/app/appearance/langs/ja.json b/app/appearance/langs/ja.json
index 7fc1b00ba5..16b3192351 100644
--- a/app/appearance/langs/ja.json
+++ b/app/appearance/langs/ja.json
@@ -1,4 +1,5 @@
{
+ "listMindmapMigrationInvalid": "このマインドマップはリストに完全に変換できないため、元のソースを保持しています",
"listMindmapRouteStart": "ドラッグして始点ノードを変更",
"listMindmapRouteEnd": "ドラッグして終点ノードを変更",
"listMindmapRouteHandle": "ドラッグして経路を調整、ハンドルをダブルクリックして自動計算に戻す",
diff --git a/app/appearance/langs/ko.json b/app/appearance/langs/ko.json
index da98b01b3d..f816a7c46a 100644
--- a/app/appearance/langs/ko.json
+++ b/app/appearance/langs/ko.json
@@ -1,4 +1,5 @@
{
+ "listMindmapMigrationInvalid": "이 마인드맵을 목록으로 완전히 변환할 수 없어 원본 소스를 유지합니다",
"listMindmapRouteStart": "드래그하여 시작 노드 변경",
"listMindmapRouteEnd": "드래그하여 대상 노드 변경",
"listMindmapRouteHandle": "드래그하여 경로 조정, 드래그 핸들을 두 번 클릭하여 자동 계산으로 복원",
diff --git a/app/appearance/langs/nl.json b/app/appearance/langs/nl.json
index f7515e7bf0..8c1a6b4cb1 100644
--- a/app/appearance/langs/nl.json
+++ b/app/appearance/langs/nl.json
@@ -1,4 +1,5 @@
{
+ "listMindmapMigrationInvalid": "Deze mindmap kon niet volledig naar een lijst worden omgezet; de oorspronkelijke bron blijft behouden",
"listMindmapRouteStart": "Sleep om het beginknooppunt te wijzigen",
"listMindmapRouteEnd": "Sleep om het doelknooppunt te wijzigen",
"listMindmapRouteHandle": "Sleep om het pad aan te passen; dubbelklik op de sleepgreep om de automatische berekening te herstellen",
diff --git a/app/appearance/langs/pl.json b/app/appearance/langs/pl.json
index 7f580d89be..185c9d3cbc 100644
--- a/app/appearance/langs/pl.json
+++ b/app/appearance/langs/pl.json
@@ -1,4 +1,5 @@
{
+ "listMindmapMigrationInvalid": "Nie udało się w pełni przekształcić tej mapy myśli w listę; zachowano tekst źródłowy",
"listMindmapRouteStart": "Przeciągnij, aby zmienić węzeł początkowy",
"listMindmapRouteEnd": "Przeciągnij, aby zmienić węzeł docelowy",
"listMindmapRouteHandle": "Przeciągnij, aby dostosować przebieg; kliknij dwukrotnie uchwyt, aby przywrócić automatyczne wyznaczanie",
diff --git a/app/appearance/langs/pt-BR.json b/app/appearance/langs/pt-BR.json
index 08e096f4be..70f659558f 100644
--- a/app/appearance/langs/pt-BR.json
+++ b/app/appearance/langs/pt-BR.json
@@ -1,4 +1,5 @@
{
+ "listMindmapMigrationInvalid": "Não foi possível converter completamente este mapa mental em uma lista; o texto original foi preservado",
"listMindmapRouteStart": "Arraste para alterar o nó inicial",
"listMindmapRouteEnd": "Arraste para alterar o nó de destino",
"listMindmapRouteHandle": "Arraste para ajustar o trajeto; clique duas vezes na alça para restaurar o cálculo automático",
diff --git a/app/appearance/langs/ru.json b/app/appearance/langs/ru.json
index b81ef3cf5e..7a619dabbd 100644
--- a/app/appearance/langs/ru.json
+++ b/app/appearance/langs/ru.json
@@ -1,4 +1,5 @@
{
+ "listMindmapMigrationInvalid": "Не удалось полностью преобразовать эту диаграмму связей в список; исходный текст сохранён",
"listMindmapRouteStart": "Перетащите, чтобы изменить начальный узел",
"listMindmapRouteEnd": "Перетащите, чтобы изменить конечный узел",
"listMindmapRouteHandle": "Перетащите, чтобы изменить путь; дважды щёлкните маркер перетаскивания, чтобы восстановить автоматический расчёт",
diff --git a/app/appearance/langs/sk.json b/app/appearance/langs/sk.json
index 358969c33a..9df22ab7e1 100644
--- a/app/appearance/langs/sk.json
+++ b/app/appearance/langs/sk.json
@@ -1,4 +1,5 @@
{
+ "listMindmapMigrationInvalid": "Túto myšlienkovú mapu sa nepodarilo úplne previesť na zoznam; pôvodný zdrojový text sa zachoval",
"listMindmapRouteStart": "Potiahnutím zmeníte počiatočný uzol",
"listMindmapRouteEnd": "Potiahnutím zmeníte cieľový uzol",
"listMindmapRouteHandle": "Potiahnutím upravíte trasu; dvojitým kliknutím na úchyt obnovíte automatický výpočet",
diff --git a/app/appearance/langs/sr.json b/app/appearance/langs/sr.json
index a6038e89a8..e45c115f94 100644
--- a/app/appearance/langs/sr.json
+++ b/app/appearance/langs/sr.json
@@ -1,4 +1,5 @@
{
+ "listMindmapMigrationInvalid": "Ову мапу ума није могуће у потпуности претворити у листу; изворни текст је сачуван",
"listMindmapRouteStart": "Превуците да промените почетни чвор",
"listMindmapRouteEnd": "Превуците да промените одредишни чвор",
"listMindmapRouteHandle": "Превуците да подесите путању; двапут кликните на ручицу за превлачење да вратите аутоматско израчунавање",
diff --git a/app/appearance/langs/th.json b/app/appearance/langs/th.json
index d29453f457..13206eb68a 100644
--- a/app/appearance/langs/th.json
+++ b/app/appearance/langs/th.json
@@ -1,4 +1,5 @@
{
+ "listMindmapMigrationInvalid": "ไม่สามารถแปลงแผนผังความคิดนี้เป็นรายการได้ทั้งหมด จึงเก็บข้อความต้นฉบับไว้",
"listMindmapRouteStart": "ลากเพื่อเปลี่ยนโหนดเริ่มต้น",
"listMindmapRouteEnd": "ลากเพื่อเปลี่ยนโหนดปลายทาง",
"listMindmapRouteHandle": "ลากเพื่อปรับเส้นทาง ดับเบิลคลิกที่จุดควบคุมเพื่อกลับไปคำนวณอัตโนมัติ",
diff --git a/app/appearance/langs/tr.json b/app/appearance/langs/tr.json
index 3d67af3543..39cf5bf181 100644
--- a/app/appearance/langs/tr.json
+++ b/app/appearance/langs/tr.json
@@ -1,4 +1,5 @@
{
+ "listMindmapMigrationInvalid": "Bu zihin haritası tamamen listeye dönüştürülemedi; özgün kaynak metni korunuyor",
"listMindmapRouteStart": "Başlangıç düğümünü değiştirmek için sürükleyin",
"listMindmapRouteEnd": "Hedef düğümü değiştirmek için sürükleyin",
"listMindmapRouteHandle": "Yolu ayarlamak için sürükleyin; otomatik hesaplamayı geri yüklemek için sürükleme tutamacına çift tıklayın",
diff --git a/app/appearance/langs/uk.json b/app/appearance/langs/uk.json
index 252fb033ac..dc6e6cee26 100644
--- a/app/appearance/langs/uk.json
+++ b/app/appearance/langs/uk.json
@@ -1,4 +1,5 @@
{
+ "listMindmapMigrationInvalid": "Не вдалося повністю перетворити цю мапу думок на список; початковий текст збережено",
"listMindmapRouteStart": "Перетягніть, щоб змінити початковий вузол",
"listMindmapRouteEnd": "Перетягніть, щоб змінити кінцевий вузол",
"listMindmapRouteHandle": "Перетягніть, щоб змінити шлях; двічі клацніть маркер перетягування, щоб відновити автоматичний розрахунок",
diff --git a/app/appearance/langs/zh-CN.json b/app/appearance/langs/zh-CN.json
index 2bb6cfa30a..1a983c97bf 100644
--- a/app/appearance/langs/zh-CN.json
+++ b/app/appearance/langs/zh-CN.json
@@ -1,4 +1,5 @@
{
+ "listMindmapMigrationInvalid": "此脑图无法完整转换为列表,已保留原始源码",
"listMindmapRouteStart": "拖动更换起始节点",
"listMindmapRouteEnd": "拖动更换目标节点",
"listMindmapRouteHandle": "拖动调整路径,双击拖拽手柄恢复自动计算",
diff --git a/app/appearance/langs/zh-TW.json b/app/appearance/langs/zh-TW.json
index 5c270475ef..9afee7f836 100644
--- a/app/appearance/langs/zh-TW.json
+++ b/app/appearance/langs/zh-TW.json
@@ -1,4 +1,5 @@
{
+ "listMindmapMigrationInvalid": "此心智圖無法完整轉換為清單,已保留原始碼",
"listMindmapRouteStart": "拖曳以變更起始節點",
"listMindmapRouteEnd": "拖曳以變更目標節點",
"listMindmapRouteHandle": "拖曳調整路徑,按兩下拖曳控制點恢復自動計算",
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 2d3cd3a0ec..1a3fc13635 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": "20260910080119"
+ "updated": "20260920131944"
},
"Children": [
{
@@ -2944,7 +2944,7 @@
"HeadingLevel": 2,
"Properties": {
"id": "20210104091509-v1x69oc",
- "updated": "20211213122625"
+ "updated": "20260920131944"
},
"Children": [
{
@@ -2955,38 +2955,1162 @@
},
{
"ID": "20210104091509-ilh76fd",
- "Type": "NodeCodeBlock",
- "IsFencedCodeBlock": true,
- "CodeBlockFenceChar": 96,
- "CodeBlockFenceLen": 3,
- "CodeBlockOpenFence": "YGBg",
- "CodeBlockInfo": "bWluZG1hcA==",
- "CodeBlockCloseFence": "YGBg",
+ "Type": "NodeList",
"Properties": {
- "id": "20210104091509-ilh76fd"
+ "id": "20210104091509-ilh76fd",
+ "updated": "20260920131944",
+ "custom-sy-list-mindmap": "1",
+ "custom-sy-list-mindmap-data": "{\"version\":1,\"nodes\":{},\"relations\":[]}"
+ },
+ "ListData": {
+ "Typ": 0,
+ "Tight": true,
+ "BulletChar": 45,
+ "Marker": "LQ=="
},
"Children": [
{
- "Type": "NodeCodeBlockFenceOpenMarker",
- "Data": "```",
- "CodeBlockFenceLen": 3
- },
- {
- "Type": "NodeCodeBlockFenceInfoMarker",
- "CodeBlockInfo": "bWluZG1hcA=="
- },
- {
- "ID": "20220307092214-u65lz3c",
- "Type": "NodeCodeBlockCode",
- "Data": "- Tutorial\n- Grammar guidance\n - General content\n - Mention users\n - Emoji\n - Some emoji examples\n - Heading-Heading 3\n - Heading 4\n - Heading 5\n - Heading 6\n - Picture\n - Code block\n - Normal\n - Syntax highlighting support\n - Demonstrate Go code highlighting\n - Demo Java highlighting\n - Ordered, disordered, task list\n - Unordered list\n - Ordered list\n - task list\n - Form\n - Hide details\n - Paragraph\n - Link reference\n - Mathematical formula\n - Mind Map\n - Flow chart\n - Timing diagram\n - Gantt chart\n - Chart\n - Staff\n - Graphviz\n - Multimedia\n - Footnote\n - Shortcuts\n",
+ "ID": "20260920131944-32pa6r2",
+ "Type": "NodeListItem",
"Properties": {
- "id": "20220307092214-u65lz3c"
- }
+ "id": "20260920131944-32pa6r2",
+ "updated": "20260920131944"
+ },
+ "ListData": {
+ "Typ": 0,
+ "BulletChar": 45,
+ "Marker": "LQ=="
+ },
+ "Children": [
+ {
+ "ID": "20260920131944-46mi5iv",
+ "Type": "NodeParagraph",
+ "Properties": {
+ "id": "20260920131944-46mi5iv",
+ "updated": "20260920131944"
+ },
+ "Children": [
+ {
+ "Type": "NodeText",
+ "Data": "Tutorial"
+ }
+ ]
+ }
+ ]
},
{
- "Type": "NodeCodeBlockFenceCloseMarker",
- "Data": "```",
- "CodeBlockFenceLen": 3
+ "ID": "20260920131944-nneeewj",
+ "Type": "NodeListItem",
+ "Properties": {
+ "id": "20260920131944-nneeewj",
+ "updated": "20260920131944"
+ },
+ "ListData": {
+ "Typ": 0,
+ "BulletChar": 45,
+ "Marker": "LQ=="
+ },
+ "Children": [
+ {
+ "ID": "20260920131944-8pwrgj0",
+ "Type": "NodeParagraph",
+ "Properties": {
+ "id": "20260920131944-8pwrgj0",
+ "updated": "20260920131944"
+ },
+ "Children": [
+ {
+ "Type": "NodeText",
+ "Data": "Grammar guidance"
+ }
+ ]
+ },
+ {
+ "ID": "20260920131944-yl7l84e",
+ "Type": "NodeList",
+ "Properties": {
+ "id": "20260920131944-yl7l84e",
+ "updated": "20260920131944"
+ },
+ "ListData": {
+ "Typ": 0,
+ "Tight": true,
+ "BulletChar": 45,
+ "Marker": "LQ=="
+ },
+ "Children": [
+ {
+ "ID": "20260920131944-ste8s04",
+ "Type": "NodeListItem",
+ "Properties": {
+ "id": "20260920131944-ste8s04",
+ "updated": "20260920131944"
+ },
+ "ListData": {
+ "Typ": 0,
+ "BulletChar": 45,
+ "Marker": "LQ=="
+ },
+ "Children": [
+ {
+ "ID": "20260920131944-mkxg6b5",
+ "Type": "NodeParagraph",
+ "Properties": {
+ "id": "20260920131944-mkxg6b5",
+ "updated": "20260920131944"
+ },
+ "Children": [
+ {
+ "Type": "NodeText",
+ "Data": "General content"
+ }
+ ]
+ }
+ ]
+ },
+ {
+ "ID": "20260920131944-vgolvcd",
+ "Type": "NodeListItem",
+ "Properties": {
+ "id": "20260920131944-vgolvcd",
+ "updated": "20260920131944"
+ },
+ "ListData": {
+ "Typ": 0,
+ "BulletChar": 45,
+ "Marker": "LQ=="
+ },
+ "Children": [
+ {
+ "ID": "20260920131944-72emauy",
+ "Type": "NodeParagraph",
+ "Properties": {
+ "id": "20260920131944-72emauy",
+ "updated": "20260920131944"
+ },
+ "Children": [
+ {
+ "Type": "NodeText",
+ "Data": "Mention users"
+ }
+ ]
+ }
+ ]
+ },
+ {
+ "ID": "20260920131944-p8pa8mj",
+ "Type": "NodeListItem",
+ "Properties": {
+ "id": "20260920131944-p8pa8mj",
+ "updated": "20260920131944"
+ },
+ "ListData": {
+ "Typ": 0,
+ "BulletChar": 45,
+ "Marker": "LQ=="
+ },
+ "Children": [
+ {
+ "ID": "20260920131944-eymvivo",
+ "Type": "NodeParagraph",
+ "Properties": {
+ "id": "20260920131944-eymvivo",
+ "updated": "20260920131944"
+ },
+ "Children": [
+ {
+ "Type": "NodeText",
+ "Data": "Emoji"
+ }
+ ]
+ },
+ {
+ "ID": "20260920131944-b70ixbx",
+ "Type": "NodeList",
+ "Properties": {
+ "id": "20260920131944-b70ixbx",
+ "updated": "20260920131944"
+ },
+ "ListData": {
+ "Typ": 0,
+ "Tight": true,
+ "BulletChar": 45,
+ "Marker": "LQ=="
+ },
+ "Children": [
+ {
+ "ID": "20260920131944-9hn3ngn",
+ "Type": "NodeListItem",
+ "Properties": {
+ "id": "20260920131944-9hn3ngn",
+ "updated": "20260920131944"
+ },
+ "ListData": {
+ "Typ": 0,
+ "BulletChar": 45,
+ "Marker": "LQ=="
+ },
+ "Children": [
+ {
+ "ID": "20260920131944-x4iokmm",
+ "Type": "NodeParagraph",
+ "Properties": {
+ "id": "20260920131944-x4iokmm",
+ "updated": "20260920131944"
+ },
+ "Children": [
+ {
+ "Type": "NodeText",
+ "Data": "Some emoji examples"
+ }
+ ]
+ }
+ ]
+ }
+ ]
+ }
+ ]
+ },
+ {
+ "ID": "20260920131944-je8tnpe",
+ "Type": "NodeListItem",
+ "Properties": {
+ "id": "20260920131944-je8tnpe",
+ "updated": "20260920131944"
+ },
+ "ListData": {
+ "Typ": 0,
+ "BulletChar": 45,
+ "Marker": "LQ=="
+ },
+ "Children": [
+ {
+ "ID": "20260920131944-q05l3vg",
+ "Type": "NodeParagraph",
+ "Properties": {
+ "id": "20260920131944-q05l3vg",
+ "updated": "20260920131944"
+ },
+ "Children": [
+ {
+ "Type": "NodeText",
+ "Data": "Heading-Heading 3"
+ }
+ ]
+ },
+ {
+ "ID": "20260920131944-hc3u4mt",
+ "Type": "NodeList",
+ "Properties": {
+ "id": "20260920131944-hc3u4mt",
+ "updated": "20260920131944"
+ },
+ "ListData": {
+ "Typ": 0,
+ "Tight": true,
+ "BulletChar": 45,
+ "Marker": "LQ=="
+ },
+ "Children": [
+ {
+ "ID": "20260920131944-zfajac1",
+ "Type": "NodeListItem",
+ "Properties": {
+ "id": "20260920131944-zfajac1",
+ "updated": "20260920131944"
+ },
+ "ListData": {
+ "Typ": 0,
+ "BulletChar": 45,
+ "Marker": "LQ=="
+ },
+ "Children": [
+ {
+ "ID": "20260920131944-eqvvly1",
+ "Type": "NodeParagraph",
+ "Properties": {
+ "id": "20260920131944-eqvvly1",
+ "updated": "20260920131944"
+ },
+ "Children": [
+ {
+ "Type": "NodeText",
+ "Data": "Heading 4"
+ }
+ ]
+ },
+ {
+ "ID": "20260920131944-yuzs9po",
+ "Type": "NodeList",
+ "Properties": {
+ "id": "20260920131944-yuzs9po",
+ "updated": "20260920131944"
+ },
+ "ListData": {
+ "Typ": 0,
+ "Tight": true,
+ "BulletChar": 45,
+ "Marker": "LQ=="
+ },
+ "Children": [
+ {
+ "ID": "20260920131944-zfr4t1i",
+ "Type": "NodeListItem",
+ "Properties": {
+ "id": "20260920131944-zfr4t1i",
+ "updated": "20260920131944"
+ },
+ "ListData": {
+ "Typ": 0,
+ "BulletChar": 45,
+ "Marker": "LQ=="
+ },
+ "Children": [
+ {
+ "ID": "20260920131944-u38zt6c",
+ "Type": "NodeParagraph",
+ "Properties": {
+ "id": "20260920131944-u38zt6c",
+ "updated": "20260920131944"
+ },
+ "Children": [
+ {
+ "Type": "NodeText",
+ "Data": "Heading 5"
+ }
+ ]
+ },
+ {
+ "ID": "20260920131944-gxyhb29",
+ "Type": "NodeList",
+ "Properties": {
+ "id": "20260920131944-gxyhb29",
+ "updated": "20260920131944"
+ },
+ "ListData": {
+ "Typ": 0,
+ "Tight": true,
+ "BulletChar": 45,
+ "Marker": "LQ=="
+ },
+ "Children": [
+ {
+ "ID": "20260920131944-d3fi5i4",
+ "Type": "NodeListItem",
+ "Properties": {
+ "id": "20260920131944-d3fi5i4",
+ "updated": "20260920131944"
+ },
+ "ListData": {
+ "Typ": 0,
+ "BulletChar": 45,
+ "Marker": "LQ=="
+ },
+ "Children": [
+ {
+ "ID": "20260920131944-upwuqer",
+ "Type": "NodeParagraph",
+ "Properties": {
+ "id": "20260920131944-upwuqer",
+ "updated": "20260920131944"
+ },
+ "Children": [
+ {
+ "Type": "NodeText",
+ "Data": "Heading 6"
+ }
+ ]
+ }
+ ]
+ }
+ ]
+ }
+ ]
+ }
+ ]
+ }
+ ]
+ }
+ ]
+ }
+ ]
+ },
+ {
+ "ID": "20260920131944-sr1m9g9",
+ "Type": "NodeListItem",
+ "Properties": {
+ "id": "20260920131944-sr1m9g9",
+ "updated": "20260920131944"
+ },
+ "ListData": {
+ "Typ": 0,
+ "BulletChar": 45,
+ "Marker": "LQ=="
+ },
+ "Children": [
+ {
+ "ID": "20260920131944-1j0dh1u",
+ "Type": "NodeParagraph",
+ "Properties": {
+ "id": "20260920131944-1j0dh1u",
+ "updated": "20260920131944"
+ },
+ "Children": [
+ {
+ "Type": "NodeText",
+ "Data": "Picture"
+ }
+ ]
+ }
+ ]
+ },
+ {
+ "ID": "20260920131944-8bv41f2",
+ "Type": "NodeListItem",
+ "Properties": {
+ "id": "20260920131944-8bv41f2",
+ "updated": "20260920131944"
+ },
+ "ListData": {
+ "Typ": 0,
+ "BulletChar": 45,
+ "Marker": "LQ=="
+ },
+ "Children": [
+ {
+ "ID": "20260920131944-575wh1r",
+ "Type": "NodeParagraph",
+ "Properties": {
+ "id": "20260920131944-575wh1r",
+ "updated": "20260920131944"
+ },
+ "Children": [
+ {
+ "Type": "NodeText",
+ "Data": "Code block"
+ }
+ ]
+ },
+ {
+ "ID": "20260920131944-164repm",
+ "Type": "NodeList",
+ "Properties": {
+ "id": "20260920131944-164repm",
+ "updated": "20260920131944"
+ },
+ "ListData": {
+ "Typ": 0,
+ "Tight": true,
+ "BulletChar": 45,
+ "Marker": "LQ=="
+ },
+ "Children": [
+ {
+ "ID": "20260920131944-zvmelb7",
+ "Type": "NodeListItem",
+ "Properties": {
+ "id": "20260920131944-zvmelb7",
+ "updated": "20260920131944"
+ },
+ "ListData": {
+ "Typ": 0,
+ "BulletChar": 45,
+ "Marker": "LQ=="
+ },
+ "Children": [
+ {
+ "ID": "20260920131944-ypkwzdp",
+ "Type": "NodeParagraph",
+ "Properties": {
+ "id": "20260920131944-ypkwzdp",
+ "updated": "20260920131944"
+ },
+ "Children": [
+ {
+ "Type": "NodeText",
+ "Data": "Normal"
+ }
+ ]
+ }
+ ]
+ },
+ {
+ "ID": "20260920131944-6x2v6j4",
+ "Type": "NodeListItem",
+ "Properties": {
+ "id": "20260920131944-6x2v6j4",
+ "updated": "20260920131944"
+ },
+ "ListData": {
+ "Typ": 0,
+ "BulletChar": 45,
+ "Marker": "LQ=="
+ },
+ "Children": [
+ {
+ "ID": "20260920131944-bptoec3",
+ "Type": "NodeParagraph",
+ "Properties": {
+ "id": "20260920131944-bptoec3",
+ "updated": "20260920131944"
+ },
+ "Children": [
+ {
+ "Type": "NodeText",
+ "Data": "Syntax highlighting support"
+ }
+ ]
+ },
+ {
+ "ID": "20260920131944-57fb48x",
+ "Type": "NodeList",
+ "Properties": {
+ "id": "20260920131944-57fb48x",
+ "updated": "20260920131944"
+ },
+ "ListData": {
+ "Typ": 0,
+ "Tight": true,
+ "BulletChar": 45,
+ "Marker": "LQ=="
+ },
+ "Children": [
+ {
+ "ID": "20260920131944-7pmm2l7",
+ "Type": "NodeListItem",
+ "Properties": {
+ "id": "20260920131944-7pmm2l7",
+ "updated": "20260920131944"
+ },
+ "ListData": {
+ "Typ": 0,
+ "BulletChar": 45,
+ "Marker": "LQ=="
+ },
+ "Children": [
+ {
+ "ID": "20260920131944-gi2fo4x",
+ "Type": "NodeParagraph",
+ "Properties": {
+ "id": "20260920131944-gi2fo4x",
+ "updated": "20260920131944"
+ },
+ "Children": [
+ {
+ "Type": "NodeText",
+ "Data": "Demonstrate Go code highlighting"
+ }
+ ]
+ }
+ ]
+ },
+ {
+ "ID": "20260920131944-3ferk3u",
+ "Type": "NodeListItem",
+ "Properties": {
+ "id": "20260920131944-3ferk3u",
+ "updated": "20260920131944"
+ },
+ "ListData": {
+ "Typ": 0,
+ "BulletChar": 45,
+ "Marker": "LQ=="
+ },
+ "Children": [
+ {
+ "ID": "20260920131944-ht517b4",
+ "Type": "NodeParagraph",
+ "Properties": {
+ "id": "20260920131944-ht517b4",
+ "updated": "20260920131944"
+ },
+ "Children": [
+ {
+ "Type": "NodeText",
+ "Data": "Demo Java highlighting"
+ }
+ ]
+ }
+ ]
+ }
+ ]
+ }
+ ]
+ }
+ ]
+ }
+ ]
+ },
+ {
+ "ID": "20260920131944-k0p2g04",
+ "Type": "NodeListItem",
+ "Properties": {
+ "id": "20260920131944-k0p2g04",
+ "updated": "20260920131944"
+ },
+ "ListData": {
+ "Typ": 0,
+ "BulletChar": 45,
+ "Marker": "LQ=="
+ },
+ "Children": [
+ {
+ "ID": "20260920131944-cq17uph",
+ "Type": "NodeParagraph",
+ "Properties": {
+ "id": "20260920131944-cq17uph",
+ "updated": "20260920131944"
+ },
+ "Children": [
+ {
+ "Type": "NodeText",
+ "Data": "Ordered, disordered, task list"
+ }
+ ]
+ },
+ {
+ "ID": "20260920131944-87nnbgu",
+ "Type": "NodeList",
+ "Properties": {
+ "id": "20260920131944-87nnbgu",
+ "updated": "20260920131944"
+ },
+ "ListData": {
+ "Typ": 0,
+ "Tight": true,
+ "BulletChar": 45,
+ "Marker": "LQ=="
+ },
+ "Children": [
+ {
+ "ID": "20260920131944-9k44l1s",
+ "Type": "NodeListItem",
+ "Properties": {
+ "id": "20260920131944-9k44l1s",
+ "updated": "20260920131944"
+ },
+ "ListData": {
+ "Typ": 0,
+ "BulletChar": 45,
+ "Marker": "LQ=="
+ },
+ "Children": [
+ {
+ "ID": "20260920131944-1boauyu",
+ "Type": "NodeParagraph",
+ "Properties": {
+ "id": "20260920131944-1boauyu",
+ "updated": "20260920131944"
+ },
+ "Children": [
+ {
+ "Type": "NodeText",
+ "Data": "Unordered list"
+ }
+ ]
+ }
+ ]
+ },
+ {
+ "ID": "20260920131944-q81qepa",
+ "Type": "NodeListItem",
+ "Properties": {
+ "id": "20260920131944-q81qepa",
+ "updated": "20260920131944"
+ },
+ "ListData": {
+ "Typ": 0,
+ "BulletChar": 45,
+ "Marker": "LQ=="
+ },
+ "Children": [
+ {
+ "ID": "20260920131944-tbv5dyc",
+ "Type": "NodeParagraph",
+ "Properties": {
+ "id": "20260920131944-tbv5dyc",
+ "updated": "20260920131944"
+ },
+ "Children": [
+ {
+ "Type": "NodeText",
+ "Data": "Ordered list"
+ }
+ ]
+ }
+ ]
+ },
+ {
+ "ID": "20260920131944-y899rob",
+ "Type": "NodeListItem",
+ "Properties": {
+ "id": "20260920131944-y899rob",
+ "updated": "20260920131944"
+ },
+ "ListData": {
+ "Typ": 0,
+ "BulletChar": 45,
+ "Marker": "LQ=="
+ },
+ "Children": [
+ {
+ "ID": "20260920131944-v22icb0",
+ "Type": "NodeParagraph",
+ "Properties": {
+ "id": "20260920131944-v22icb0",
+ "updated": "20260920131944"
+ },
+ "Children": [
+ {
+ "Type": "NodeText",
+ "Data": "task list"
+ }
+ ]
+ }
+ ]
+ }
+ ]
+ }
+ ]
+ },
+ {
+ "ID": "20260920131944-4g4s51d",
+ "Type": "NodeListItem",
+ "Properties": {
+ "id": "20260920131944-4g4s51d",
+ "updated": "20260920131944"
+ },
+ "ListData": {
+ "Typ": 0,
+ "BulletChar": 45,
+ "Marker": "LQ=="
+ },
+ "Children": [
+ {
+ "ID": "20260920131944-smfuunp",
+ "Type": "NodeParagraph",
+ "Properties": {
+ "id": "20260920131944-smfuunp",
+ "updated": "20260920131944"
+ },
+ "Children": [
+ {
+ "Type": "NodeText",
+ "Data": "Form"
+ }
+ ]
+ }
+ ]
+ },
+ {
+ "ID": "20260920131944-nyt13uo",
+ "Type": "NodeListItem",
+ "Properties": {
+ "id": "20260920131944-nyt13uo",
+ "updated": "20260920131944"
+ },
+ "ListData": {
+ "Typ": 0,
+ "BulletChar": 45,
+ "Marker": "LQ=="
+ },
+ "Children": [
+ {
+ "ID": "20260920131944-td8trau",
+ "Type": "NodeParagraph",
+ "Properties": {
+ "id": "20260920131944-td8trau",
+ "updated": "20260920131944"
+ },
+ "Children": [
+ {
+ "Type": "NodeText",
+ "Data": "Hide details"
+ }
+ ]
+ }
+ ]
+ },
+ {
+ "ID": "20260920131944-kk2e5d0",
+ "Type": "NodeListItem",
+ "Properties": {
+ "id": "20260920131944-kk2e5d0",
+ "updated": "20260920131944"
+ },
+ "ListData": {
+ "Typ": 0,
+ "BulletChar": 45,
+ "Marker": "LQ=="
+ },
+ "Children": [
+ {
+ "ID": "20260920131944-zg7ypmn",
+ "Type": "NodeParagraph",
+ "Properties": {
+ "id": "20260920131944-zg7ypmn",
+ "updated": "20260920131944"
+ },
+ "Children": [
+ {
+ "Type": "NodeText",
+ "Data": "Paragraph"
+ }
+ ]
+ }
+ ]
+ },
+ {
+ "ID": "20260920131944-uj1mkik",
+ "Type": "NodeListItem",
+ "Properties": {
+ "id": "20260920131944-uj1mkik",
+ "updated": "20260920131944"
+ },
+ "ListData": {
+ "Typ": 0,
+ "BulletChar": 45,
+ "Marker": "LQ=="
+ },
+ "Children": [
+ {
+ "ID": "20260920131944-ybk5iok",
+ "Type": "NodeParagraph",
+ "Properties": {
+ "id": "20260920131944-ybk5iok",
+ "updated": "20260920131944"
+ },
+ "Children": [
+ {
+ "Type": "NodeText",
+ "Data": "Link reference"
+ }
+ ]
+ }
+ ]
+ },
+ {
+ "ID": "20260920131944-j0ntarq",
+ "Type": "NodeListItem",
+ "Properties": {
+ "id": "20260920131944-j0ntarq",
+ "updated": "20260920131944"
+ },
+ "ListData": {
+ "Typ": 0,
+ "BulletChar": 45,
+ "Marker": "LQ=="
+ },
+ "Children": [
+ {
+ "ID": "20260920131944-18gdowp",
+ "Type": "NodeParagraph",
+ "Properties": {
+ "id": "20260920131944-18gdowp",
+ "updated": "20260920131944"
+ },
+ "Children": [
+ {
+ "Type": "NodeText",
+ "Data": "Mathematical formula"
+ }
+ ]
+ }
+ ]
+ },
+ {
+ "ID": "20260920131944-yejr476",
+ "Type": "NodeListItem",
+ "Properties": {
+ "id": "20260920131944-yejr476",
+ "updated": "20260920131944"
+ },
+ "ListData": {
+ "Typ": 0,
+ "BulletChar": 45,
+ "Marker": "LQ=="
+ },
+ "Children": [
+ {
+ "ID": "20260920131944-mtjb2gb",
+ "Type": "NodeParagraph",
+ "Properties": {
+ "id": "20260920131944-mtjb2gb",
+ "updated": "20260920131944"
+ },
+ "Children": [
+ {
+ "Type": "NodeText",
+ "Data": "Mind Map"
+ }
+ ]
+ }
+ ]
+ },
+ {
+ "ID": "20260920131944-gcleek7",
+ "Type": "NodeListItem",
+ "Properties": {
+ "id": "20260920131944-gcleek7",
+ "updated": "20260920131944"
+ },
+ "ListData": {
+ "Typ": 0,
+ "BulletChar": 45,
+ "Marker": "LQ=="
+ },
+ "Children": [
+ {
+ "ID": "20260920131944-a1aeqg9",
+ "Type": "NodeParagraph",
+ "Properties": {
+ "id": "20260920131944-a1aeqg9",
+ "updated": "20260920131944"
+ },
+ "Children": [
+ {
+ "Type": "NodeText",
+ "Data": "Flow chart"
+ }
+ ]
+ }
+ ]
+ },
+ {
+ "ID": "20260920131944-u944mbs",
+ "Type": "NodeListItem",
+ "Properties": {
+ "id": "20260920131944-u944mbs",
+ "updated": "20260920131944"
+ },
+ "ListData": {
+ "Typ": 0,
+ "BulletChar": 45,
+ "Marker": "LQ=="
+ },
+ "Children": [
+ {
+ "ID": "20260920131944-hnvdb8d",
+ "Type": "NodeParagraph",
+ "Properties": {
+ "id": "20260920131944-hnvdb8d",
+ "updated": "20260920131944"
+ },
+ "Children": [
+ {
+ "Type": "NodeText",
+ "Data": "Timing diagram"
+ }
+ ]
+ }
+ ]
+ },
+ {
+ "ID": "20260920131944-5ljorc6",
+ "Type": "NodeListItem",
+ "Properties": {
+ "id": "20260920131944-5ljorc6",
+ "updated": "20260920131944"
+ },
+ "ListData": {
+ "Typ": 0,
+ "BulletChar": 45,
+ "Marker": "LQ=="
+ },
+ "Children": [
+ {
+ "ID": "20260920131944-3jokn5i",
+ "Type": "NodeParagraph",
+ "Properties": {
+ "id": "20260920131944-3jokn5i",
+ "updated": "20260920131944"
+ },
+ "Children": [
+ {
+ "Type": "NodeText",
+ "Data": "Gantt chart"
+ }
+ ]
+ }
+ ]
+ },
+ {
+ "ID": "20260920131944-0khw9tq",
+ "Type": "NodeListItem",
+ "Properties": {
+ "id": "20260920131944-0khw9tq",
+ "updated": "20260920131944"
+ },
+ "ListData": {
+ "Typ": 0,
+ "BulletChar": 45,
+ "Marker": "LQ=="
+ },
+ "Children": [
+ {
+ "ID": "20260920131944-bjpzmgc",
+ "Type": "NodeParagraph",
+ "Properties": {
+ "id": "20260920131944-bjpzmgc",
+ "updated": "20260920131944"
+ },
+ "Children": [
+ {
+ "Type": "NodeText",
+ "Data": "Chart"
+ }
+ ]
+ }
+ ]
+ },
+ {
+ "ID": "20260920131944-xtp71q3",
+ "Type": "NodeListItem",
+ "Properties": {
+ "id": "20260920131944-xtp71q3",
+ "updated": "20260920131944"
+ },
+ "ListData": {
+ "Typ": 0,
+ "BulletChar": 45,
+ "Marker": "LQ=="
+ },
+ "Children": [
+ {
+ "ID": "20260920131944-yizx32a",
+ "Type": "NodeParagraph",
+ "Properties": {
+ "id": "20260920131944-yizx32a",
+ "updated": "20260920131944"
+ },
+ "Children": [
+ {
+ "Type": "NodeText",
+ "Data": "Staff"
+ }
+ ]
+ }
+ ]
+ },
+ {
+ "ID": "20260920131944-s61x53e",
+ "Type": "NodeListItem",
+ "Properties": {
+ "id": "20260920131944-s61x53e",
+ "updated": "20260920131944"
+ },
+ "ListData": {
+ "Typ": 0,
+ "BulletChar": 45,
+ "Marker": "LQ=="
+ },
+ "Children": [
+ {
+ "ID": "20260920131944-unhvte8",
+ "Type": "NodeParagraph",
+ "Properties": {
+ "id": "20260920131944-unhvte8",
+ "updated": "20260920131944"
+ },
+ "Children": [
+ {
+ "Type": "NodeText",
+ "Data": "Graphviz"
+ }
+ ]
+ }
+ ]
+ },
+ {
+ "ID": "20260920131944-izfgynr",
+ "Type": "NodeListItem",
+ "Properties": {
+ "id": "20260920131944-izfgynr",
+ "updated": "20260920131944"
+ },
+ "ListData": {
+ "Typ": 0,
+ "BulletChar": 45,
+ "Marker": "LQ=="
+ },
+ "Children": [
+ {
+ "ID": "20260920131944-uzevhaz",
+ "Type": "NodeParagraph",
+ "Properties": {
+ "id": "20260920131944-uzevhaz",
+ "updated": "20260920131944"
+ },
+ "Children": [
+ {
+ "Type": "NodeText",
+ "Data": "Multimedia"
+ }
+ ]
+ }
+ ]
+ },
+ {
+ "ID": "20260920131944-t87lh69",
+ "Type": "NodeListItem",
+ "Properties": {
+ "id": "20260920131944-t87lh69",
+ "updated": "20260920131944"
+ },
+ "ListData": {
+ "Typ": 0,
+ "BulletChar": 45,
+ "Marker": "LQ=="
+ },
+ "Children": [
+ {
+ "ID": "20260920131944-ww63hrg",
+ "Type": "NodeParagraph",
+ "Properties": {
+ "id": "20260920131944-ww63hrg",
+ "updated": "20260920131944"
+ },
+ "Children": [
+ {
+ "Type": "NodeText",
+ "Data": "Footnote"
+ }
+ ]
+ }
+ ]
+ },
+ {
+ "ID": "20260920131944-0noiniq",
+ "Type": "NodeListItem",
+ "Properties": {
+ "id": "20260920131944-0noiniq",
+ "updated": "20260920131944"
+ },
+ "ListData": {
+ "Typ": 0,
+ "BulletChar": 45,
+ "Marker": "LQ=="
+ },
+ "Children": [
+ {
+ "ID": "20260920131944-xbkywi5",
+ "Type": "NodeParagraph",
+ "Properties": {
+ "id": "20260920131944-xbkywi5",
+ "updated": "20260920131944"
+ },
+ "Children": [
+ {
+ "Type": "NodeText",
+ "Data": "Shortcuts"
+ }
+ ]
+ }
+ ]
+ }
+ ]
+ }
+ ]
}
]
},
@@ -2995,12 +4119,12 @@
"Type": "NodeParagraph",
"Properties": {
"id": "20211213122548-xg047h3",
- "updated": "20211213122621"
+ "updated": "20260920131944"
},
"Children": [
{
"Type": "NodeText",
- "Data": "Use Markdown list syntax to render the mind map."
+ "Data": "Create a mind map from the slash menu, or switch a list block to mind map view. Opening an editable document automatically converts old mind maps to list mind maps while preserving block IDs and content. Conversion supports undo and document history recovery. Content that cannot be fully converted is preserved and displayed as source. Read-only views and exports display a temporary conversion without changing the original document."
}
]
},
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 59eead409e..6db6123984 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": "20260910080119"
+ "updated": "20260920131944"
},
"Children": [
{
@@ -2939,7 +2939,7 @@
"HeadingLevel": 2,
"Properties": {
"id": "20210104091228-wdpx6ev",
- "updated": "20210415200555"
+ "updated": "20260920131944"
},
"Children": [
{
@@ -2950,38 +2950,1162 @@
},
{
"ID": "20210104091228-xdtxrto",
- "Type": "NodeCodeBlock",
- "IsFencedCodeBlock": true,
- "CodeBlockFenceChar": 96,
- "CodeBlockFenceLen": 3,
- "CodeBlockOpenFence": "YGBg",
- "CodeBlockInfo": "bWluZG1hcA==",
- "CodeBlockCloseFence": "YGBg",
+ "Type": "NodeList",
"Properties": {
- "id": "20210104091228-xdtxrto"
+ "id": "20210104091228-xdtxrto",
+ "updated": "20260920131944",
+ "custom-sy-list-mindmap": "1",
+ "custom-sy-list-mindmap-data": "{\"version\":1,\"nodes\":{},\"relations\":[]}"
+ },
+ "ListData": {
+ "Typ": 0,
+ "Tight": true,
+ "BulletChar": 45,
+ "Marker": "LQ=="
},
"Children": [
{
- "Type": "NodeCodeBlockFenceOpenMarker",
- "Data": "```",
- "CodeBlockFenceLen": 3
- },
- {
- "Type": "NodeCodeBlockFenceInfoMarker",
- "CodeBlockInfo": "bWluZG1hcA=="
- },
- {
- "ID": "20220307091943-skwnjw2",
- "Type": "NodeCodeBlockCode",
- "Data": "- 教程\n- 语法指导\n - 普通内容\n - 提及用户\n - 表情符号 Emoji\n - 一些表情例子\n - 大标题 - Heading 3\n - Heading 4\n - Heading 5\n - Heading 6\n - 图片\n - 代码块\n - 普通\n - 语法高亮支持\n - 演示 Go 代码高亮\n - 演示 Java 高亮\n - 有序、无序、任务列表\n - 无序列表\n - 有序列表\n - 任务列表\n - 表格\n - 隐藏细节\n - 段落\n - 链接引用\n - 数学公式\n - 脑图\n - 流程图\n - 时序图\n - 甘特图\n - 图表\n - 五线谱\n - Graphviz\n - 多媒体\n - 脚注\n- 快捷键\n",
+ "ID": "20260920131944-pwoi7ws",
+ "Type": "NodeListItem",
"Properties": {
- "id": "20220307091943-skwnjw2"
- }
+ "id": "20260920131944-pwoi7ws",
+ "updated": "20260920131944"
+ },
+ "ListData": {
+ "Typ": 0,
+ "BulletChar": 45,
+ "Marker": "LQ=="
+ },
+ "Children": [
+ {
+ "ID": "20260920131944-bz89kwh",
+ "Type": "NodeParagraph",
+ "Properties": {
+ "id": "20260920131944-bz89kwh",
+ "updated": "20260920131944"
+ },
+ "Children": [
+ {
+ "Type": "NodeText",
+ "Data": "教程"
+ }
+ ]
+ }
+ ]
},
{
- "Type": "NodeCodeBlockFenceCloseMarker",
- "Data": "```",
- "CodeBlockFenceLen": 3
+ "ID": "20260920131944-wvlgzh1",
+ "Type": "NodeListItem",
+ "Properties": {
+ "id": "20260920131944-wvlgzh1",
+ "updated": "20260920131944"
+ },
+ "ListData": {
+ "Typ": 0,
+ "BulletChar": 45,
+ "Marker": "LQ=="
+ },
+ "Children": [
+ {
+ "ID": "20260920131944-e9nvcmg",
+ "Type": "NodeParagraph",
+ "Properties": {
+ "id": "20260920131944-e9nvcmg",
+ "updated": "20260920131944"
+ },
+ "Children": [
+ {
+ "Type": "NodeText",
+ "Data": "语法指导"
+ }
+ ]
+ },
+ {
+ "ID": "20260920131944-3x0fvb7",
+ "Type": "NodeList",
+ "Properties": {
+ "id": "20260920131944-3x0fvb7",
+ "updated": "20260920131944"
+ },
+ "ListData": {
+ "Typ": 0,
+ "Tight": true,
+ "BulletChar": 45,
+ "Marker": "LQ=="
+ },
+ "Children": [
+ {
+ "ID": "20260920131944-xtiqpsu",
+ "Type": "NodeListItem",
+ "Properties": {
+ "id": "20260920131944-xtiqpsu",
+ "updated": "20260920131944"
+ },
+ "ListData": {
+ "Typ": 0,
+ "BulletChar": 45,
+ "Marker": "LQ=="
+ },
+ "Children": [
+ {
+ "ID": "20260920131944-4ksh150",
+ "Type": "NodeParagraph",
+ "Properties": {
+ "id": "20260920131944-4ksh150",
+ "updated": "20260920131944"
+ },
+ "Children": [
+ {
+ "Type": "NodeText",
+ "Data": "普通内容"
+ }
+ ]
+ }
+ ]
+ },
+ {
+ "ID": "20260920131944-w8k1qp7",
+ "Type": "NodeListItem",
+ "Properties": {
+ "id": "20260920131944-w8k1qp7",
+ "updated": "20260920131944"
+ },
+ "ListData": {
+ "Typ": 0,
+ "BulletChar": 45,
+ "Marker": "LQ=="
+ },
+ "Children": [
+ {
+ "ID": "20260920131944-c2focur",
+ "Type": "NodeParagraph",
+ "Properties": {
+ "id": "20260920131944-c2focur",
+ "updated": "20260920131944"
+ },
+ "Children": [
+ {
+ "Type": "NodeText",
+ "Data": "提及用户"
+ }
+ ]
+ }
+ ]
+ },
+ {
+ "ID": "20260920131944-dci00dz",
+ "Type": "NodeListItem",
+ "Properties": {
+ "id": "20260920131944-dci00dz",
+ "updated": "20260920131944"
+ },
+ "ListData": {
+ "Typ": 0,
+ "BulletChar": 45,
+ "Marker": "LQ=="
+ },
+ "Children": [
+ {
+ "ID": "20260920131944-savejxu",
+ "Type": "NodeParagraph",
+ "Properties": {
+ "id": "20260920131944-savejxu",
+ "updated": "20260920131944"
+ },
+ "Children": [
+ {
+ "Type": "NodeText",
+ "Data": "表情符号 Emoji"
+ }
+ ]
+ },
+ {
+ "ID": "20260920131944-d4r6u0v",
+ "Type": "NodeList",
+ "Properties": {
+ "id": "20260920131944-d4r6u0v",
+ "updated": "20260920131944"
+ },
+ "ListData": {
+ "Typ": 0,
+ "Tight": true,
+ "BulletChar": 45,
+ "Marker": "LQ=="
+ },
+ "Children": [
+ {
+ "ID": "20260920131944-nkv9y70",
+ "Type": "NodeListItem",
+ "Properties": {
+ "id": "20260920131944-nkv9y70",
+ "updated": "20260920131944"
+ },
+ "ListData": {
+ "Typ": 0,
+ "BulletChar": 45,
+ "Marker": "LQ=="
+ },
+ "Children": [
+ {
+ "ID": "20260920131944-7lyvuyg",
+ "Type": "NodeParagraph",
+ "Properties": {
+ "id": "20260920131944-7lyvuyg",
+ "updated": "20260920131944"
+ },
+ "Children": [
+ {
+ "Type": "NodeText",
+ "Data": "一些表情例子"
+ }
+ ]
+ }
+ ]
+ }
+ ]
+ }
+ ]
+ },
+ {
+ "ID": "20260920131944-0krj57o",
+ "Type": "NodeListItem",
+ "Properties": {
+ "id": "20260920131944-0krj57o",
+ "updated": "20260920131944"
+ },
+ "ListData": {
+ "Typ": 0,
+ "BulletChar": 45,
+ "Marker": "LQ=="
+ },
+ "Children": [
+ {
+ "ID": "20260920131944-66yk529",
+ "Type": "NodeParagraph",
+ "Properties": {
+ "id": "20260920131944-66yk529",
+ "updated": "20260920131944"
+ },
+ "Children": [
+ {
+ "Type": "NodeText",
+ "Data": "大标题 - Heading 3"
+ }
+ ]
+ },
+ {
+ "ID": "20260920131944-40kvij8",
+ "Type": "NodeList",
+ "Properties": {
+ "id": "20260920131944-40kvij8",
+ "updated": "20260920131944"
+ },
+ "ListData": {
+ "Typ": 0,
+ "Tight": true,
+ "BulletChar": 45,
+ "Marker": "LQ=="
+ },
+ "Children": [
+ {
+ "ID": "20260920131944-a1ia83v",
+ "Type": "NodeListItem",
+ "Properties": {
+ "id": "20260920131944-a1ia83v",
+ "updated": "20260920131944"
+ },
+ "ListData": {
+ "Typ": 0,
+ "BulletChar": 45,
+ "Marker": "LQ=="
+ },
+ "Children": [
+ {
+ "ID": "20260920131944-j7hzeyc",
+ "Type": "NodeParagraph",
+ "Properties": {
+ "id": "20260920131944-j7hzeyc",
+ "updated": "20260920131944"
+ },
+ "Children": [
+ {
+ "Type": "NodeText",
+ "Data": "Heading 4"
+ }
+ ]
+ },
+ {
+ "ID": "20260920131944-k6vro4l",
+ "Type": "NodeList",
+ "Properties": {
+ "id": "20260920131944-k6vro4l",
+ "updated": "20260920131944"
+ },
+ "ListData": {
+ "Typ": 0,
+ "Tight": true,
+ "BulletChar": 45,
+ "Marker": "LQ=="
+ },
+ "Children": [
+ {
+ "ID": "20260920131944-m7q66ff",
+ "Type": "NodeListItem",
+ "Properties": {
+ "id": "20260920131944-m7q66ff",
+ "updated": "20260920131944"
+ },
+ "ListData": {
+ "Typ": 0,
+ "BulletChar": 45,
+ "Marker": "LQ=="
+ },
+ "Children": [
+ {
+ "ID": "20260920131944-fpaf9ca",
+ "Type": "NodeParagraph",
+ "Properties": {
+ "id": "20260920131944-fpaf9ca",
+ "updated": "20260920131944"
+ },
+ "Children": [
+ {
+ "Type": "NodeText",
+ "Data": "Heading 5"
+ }
+ ]
+ },
+ {
+ "ID": "20260920131944-ic3lrc4",
+ "Type": "NodeList",
+ "Properties": {
+ "id": "20260920131944-ic3lrc4",
+ "updated": "20260920131944"
+ },
+ "ListData": {
+ "Typ": 0,
+ "Tight": true,
+ "BulletChar": 45,
+ "Marker": "LQ=="
+ },
+ "Children": [
+ {
+ "ID": "20260920131944-77152ol",
+ "Type": "NodeListItem",
+ "Properties": {
+ "id": "20260920131944-77152ol",
+ "updated": "20260920131944"
+ },
+ "ListData": {
+ "Typ": 0,
+ "BulletChar": 45,
+ "Marker": "LQ=="
+ },
+ "Children": [
+ {
+ "ID": "20260920131944-848kz4m",
+ "Type": "NodeParagraph",
+ "Properties": {
+ "id": "20260920131944-848kz4m",
+ "updated": "20260920131944"
+ },
+ "Children": [
+ {
+ "Type": "NodeText",
+ "Data": "Heading 6"
+ }
+ ]
+ }
+ ]
+ }
+ ]
+ }
+ ]
+ }
+ ]
+ }
+ ]
+ }
+ ]
+ }
+ ]
+ },
+ {
+ "ID": "20260920131944-01kkca1",
+ "Type": "NodeListItem",
+ "Properties": {
+ "id": "20260920131944-01kkca1",
+ "updated": "20260920131944"
+ },
+ "ListData": {
+ "Typ": 0,
+ "BulletChar": 45,
+ "Marker": "LQ=="
+ },
+ "Children": [
+ {
+ "ID": "20260920131944-0as227w",
+ "Type": "NodeParagraph",
+ "Properties": {
+ "id": "20260920131944-0as227w",
+ "updated": "20260920131944"
+ },
+ "Children": [
+ {
+ "Type": "NodeText",
+ "Data": "图片"
+ }
+ ]
+ }
+ ]
+ },
+ {
+ "ID": "20260920131944-7v77md4",
+ "Type": "NodeListItem",
+ "Properties": {
+ "id": "20260920131944-7v77md4",
+ "updated": "20260920131944"
+ },
+ "ListData": {
+ "Typ": 0,
+ "BulletChar": 45,
+ "Marker": "LQ=="
+ },
+ "Children": [
+ {
+ "ID": "20260920131944-80j1hji",
+ "Type": "NodeParagraph",
+ "Properties": {
+ "id": "20260920131944-80j1hji",
+ "updated": "20260920131944"
+ },
+ "Children": [
+ {
+ "Type": "NodeText",
+ "Data": "代码块"
+ }
+ ]
+ },
+ {
+ "ID": "20260920131944-ctqzw5x",
+ "Type": "NodeList",
+ "Properties": {
+ "id": "20260920131944-ctqzw5x",
+ "updated": "20260920131944"
+ },
+ "ListData": {
+ "Typ": 0,
+ "Tight": true,
+ "BulletChar": 45,
+ "Marker": "LQ=="
+ },
+ "Children": [
+ {
+ "ID": "20260920131944-5e7o3vh",
+ "Type": "NodeListItem",
+ "Properties": {
+ "id": "20260920131944-5e7o3vh",
+ "updated": "20260920131944"
+ },
+ "ListData": {
+ "Typ": 0,
+ "BulletChar": 45,
+ "Marker": "LQ=="
+ },
+ "Children": [
+ {
+ "ID": "20260920131944-lt5bxao",
+ "Type": "NodeParagraph",
+ "Properties": {
+ "id": "20260920131944-lt5bxao",
+ "updated": "20260920131944"
+ },
+ "Children": [
+ {
+ "Type": "NodeText",
+ "Data": "普通"
+ }
+ ]
+ }
+ ]
+ },
+ {
+ "ID": "20260920131944-gox1msk",
+ "Type": "NodeListItem",
+ "Properties": {
+ "id": "20260920131944-gox1msk",
+ "updated": "20260920131944"
+ },
+ "ListData": {
+ "Typ": 0,
+ "BulletChar": 45,
+ "Marker": "LQ=="
+ },
+ "Children": [
+ {
+ "ID": "20260920131944-0l68pml",
+ "Type": "NodeParagraph",
+ "Properties": {
+ "id": "20260920131944-0l68pml",
+ "updated": "20260920131944"
+ },
+ "Children": [
+ {
+ "Type": "NodeText",
+ "Data": "语法高亮支持"
+ }
+ ]
+ },
+ {
+ "ID": "20260920131944-yrkerej",
+ "Type": "NodeList",
+ "Properties": {
+ "id": "20260920131944-yrkerej",
+ "updated": "20260920131944"
+ },
+ "ListData": {
+ "Typ": 0,
+ "Tight": true,
+ "BulletChar": 45,
+ "Marker": "LQ=="
+ },
+ "Children": [
+ {
+ "ID": "20260920131944-ri5nhkj",
+ "Type": "NodeListItem",
+ "Properties": {
+ "id": "20260920131944-ri5nhkj",
+ "updated": "20260920131944"
+ },
+ "ListData": {
+ "Typ": 0,
+ "BulletChar": 45,
+ "Marker": "LQ=="
+ },
+ "Children": [
+ {
+ "ID": "20260920131944-f9sh1av",
+ "Type": "NodeParagraph",
+ "Properties": {
+ "id": "20260920131944-f9sh1av",
+ "updated": "20260920131944"
+ },
+ "Children": [
+ {
+ "Type": "NodeText",
+ "Data": "演示 Go 代码高亮"
+ }
+ ]
+ }
+ ]
+ },
+ {
+ "ID": "20260920131944-hbl4b89",
+ "Type": "NodeListItem",
+ "Properties": {
+ "id": "20260920131944-hbl4b89",
+ "updated": "20260920131944"
+ },
+ "ListData": {
+ "Typ": 0,
+ "BulletChar": 45,
+ "Marker": "LQ=="
+ },
+ "Children": [
+ {
+ "ID": "20260920131944-nj6j6xf",
+ "Type": "NodeParagraph",
+ "Properties": {
+ "id": "20260920131944-nj6j6xf",
+ "updated": "20260920131944"
+ },
+ "Children": [
+ {
+ "Type": "NodeText",
+ "Data": "演示 Java 高亮"
+ }
+ ]
+ }
+ ]
+ }
+ ]
+ }
+ ]
+ }
+ ]
+ }
+ ]
+ },
+ {
+ "ID": "20260920131944-oj408ho",
+ "Type": "NodeListItem",
+ "Properties": {
+ "id": "20260920131944-oj408ho",
+ "updated": "20260920131944"
+ },
+ "ListData": {
+ "Typ": 0,
+ "BulletChar": 45,
+ "Marker": "LQ=="
+ },
+ "Children": [
+ {
+ "ID": "20260920131944-wbseed1",
+ "Type": "NodeParagraph",
+ "Properties": {
+ "id": "20260920131944-wbseed1",
+ "updated": "20260920131944"
+ },
+ "Children": [
+ {
+ "Type": "NodeText",
+ "Data": "有序、无序、任务列表"
+ }
+ ]
+ },
+ {
+ "ID": "20260920131944-d62ly26",
+ "Type": "NodeList",
+ "Properties": {
+ "id": "20260920131944-d62ly26",
+ "updated": "20260920131944"
+ },
+ "ListData": {
+ "Typ": 0,
+ "Tight": true,
+ "BulletChar": 45,
+ "Marker": "LQ=="
+ },
+ "Children": [
+ {
+ "ID": "20260920131944-p5dogep",
+ "Type": "NodeListItem",
+ "Properties": {
+ "id": "20260920131944-p5dogep",
+ "updated": "20260920131944"
+ },
+ "ListData": {
+ "Typ": 0,
+ "BulletChar": 45,
+ "Marker": "LQ=="
+ },
+ "Children": [
+ {
+ "ID": "20260920131944-7swcv1m",
+ "Type": "NodeParagraph",
+ "Properties": {
+ "id": "20260920131944-7swcv1m",
+ "updated": "20260920131944"
+ },
+ "Children": [
+ {
+ "Type": "NodeText",
+ "Data": "无序列表"
+ }
+ ]
+ }
+ ]
+ },
+ {
+ "ID": "20260920131944-jsg0kqt",
+ "Type": "NodeListItem",
+ "Properties": {
+ "id": "20260920131944-jsg0kqt",
+ "updated": "20260920131944"
+ },
+ "ListData": {
+ "Typ": 0,
+ "BulletChar": 45,
+ "Marker": "LQ=="
+ },
+ "Children": [
+ {
+ "ID": "20260920131944-l69bou2",
+ "Type": "NodeParagraph",
+ "Properties": {
+ "id": "20260920131944-l69bou2",
+ "updated": "20260920131944"
+ },
+ "Children": [
+ {
+ "Type": "NodeText",
+ "Data": "有序列表"
+ }
+ ]
+ }
+ ]
+ },
+ {
+ "ID": "20260920131944-khwd8lq",
+ "Type": "NodeListItem",
+ "Properties": {
+ "id": "20260920131944-khwd8lq",
+ "updated": "20260920131944"
+ },
+ "ListData": {
+ "Typ": 0,
+ "BulletChar": 45,
+ "Marker": "LQ=="
+ },
+ "Children": [
+ {
+ "ID": "20260920131944-goj7npy",
+ "Type": "NodeParagraph",
+ "Properties": {
+ "id": "20260920131944-goj7npy",
+ "updated": "20260920131944"
+ },
+ "Children": [
+ {
+ "Type": "NodeText",
+ "Data": "任务列表"
+ }
+ ]
+ }
+ ]
+ }
+ ]
+ }
+ ]
+ },
+ {
+ "ID": "20260920131944-sd3sgrf",
+ "Type": "NodeListItem",
+ "Properties": {
+ "id": "20260920131944-sd3sgrf",
+ "updated": "20260920131944"
+ },
+ "ListData": {
+ "Typ": 0,
+ "BulletChar": 45,
+ "Marker": "LQ=="
+ },
+ "Children": [
+ {
+ "ID": "20260920131944-584co3x",
+ "Type": "NodeParagraph",
+ "Properties": {
+ "id": "20260920131944-584co3x",
+ "updated": "20260920131944"
+ },
+ "Children": [
+ {
+ "Type": "NodeText",
+ "Data": "表格"
+ }
+ ]
+ }
+ ]
+ },
+ {
+ "ID": "20260920131944-ktxftqr",
+ "Type": "NodeListItem",
+ "Properties": {
+ "id": "20260920131944-ktxftqr",
+ "updated": "20260920131944"
+ },
+ "ListData": {
+ "Typ": 0,
+ "BulletChar": 45,
+ "Marker": "LQ=="
+ },
+ "Children": [
+ {
+ "ID": "20260920131944-07ts15i",
+ "Type": "NodeParagraph",
+ "Properties": {
+ "id": "20260920131944-07ts15i",
+ "updated": "20260920131944"
+ },
+ "Children": [
+ {
+ "Type": "NodeText",
+ "Data": "隐藏细节"
+ }
+ ]
+ }
+ ]
+ },
+ {
+ "ID": "20260920131944-dmqpt6l",
+ "Type": "NodeListItem",
+ "Properties": {
+ "id": "20260920131944-dmqpt6l",
+ "updated": "20260920131944"
+ },
+ "ListData": {
+ "Typ": 0,
+ "BulletChar": 45,
+ "Marker": "LQ=="
+ },
+ "Children": [
+ {
+ "ID": "20260920131944-u83p75f",
+ "Type": "NodeParagraph",
+ "Properties": {
+ "id": "20260920131944-u83p75f",
+ "updated": "20260920131944"
+ },
+ "Children": [
+ {
+ "Type": "NodeText",
+ "Data": "段落"
+ }
+ ]
+ }
+ ]
+ },
+ {
+ "ID": "20260920131944-elad2nl",
+ "Type": "NodeListItem",
+ "Properties": {
+ "id": "20260920131944-elad2nl",
+ "updated": "20260920131944"
+ },
+ "ListData": {
+ "Typ": 0,
+ "BulletChar": 45,
+ "Marker": "LQ=="
+ },
+ "Children": [
+ {
+ "ID": "20260920131944-skt9fxb",
+ "Type": "NodeParagraph",
+ "Properties": {
+ "id": "20260920131944-skt9fxb",
+ "updated": "20260920131944"
+ },
+ "Children": [
+ {
+ "Type": "NodeText",
+ "Data": "链接引用"
+ }
+ ]
+ }
+ ]
+ },
+ {
+ "ID": "20260920131944-r30m3du",
+ "Type": "NodeListItem",
+ "Properties": {
+ "id": "20260920131944-r30m3du",
+ "updated": "20260920131944"
+ },
+ "ListData": {
+ "Typ": 0,
+ "BulletChar": 45,
+ "Marker": "LQ=="
+ },
+ "Children": [
+ {
+ "ID": "20260920131944-vlnfpb7",
+ "Type": "NodeParagraph",
+ "Properties": {
+ "id": "20260920131944-vlnfpb7",
+ "updated": "20260920131944"
+ },
+ "Children": [
+ {
+ "Type": "NodeText",
+ "Data": "数学公式"
+ }
+ ]
+ }
+ ]
+ },
+ {
+ "ID": "20260920131944-8maw7l2",
+ "Type": "NodeListItem",
+ "Properties": {
+ "id": "20260920131944-8maw7l2",
+ "updated": "20260920131944"
+ },
+ "ListData": {
+ "Typ": 0,
+ "BulletChar": 45,
+ "Marker": "LQ=="
+ },
+ "Children": [
+ {
+ "ID": "20260920131944-sg6s1p8",
+ "Type": "NodeParagraph",
+ "Properties": {
+ "id": "20260920131944-sg6s1p8",
+ "updated": "20260920131944"
+ },
+ "Children": [
+ {
+ "Type": "NodeText",
+ "Data": "脑图"
+ }
+ ]
+ }
+ ]
+ },
+ {
+ "ID": "20260920131944-9dg1634",
+ "Type": "NodeListItem",
+ "Properties": {
+ "id": "20260920131944-9dg1634",
+ "updated": "20260920131944"
+ },
+ "ListData": {
+ "Typ": 0,
+ "BulletChar": 45,
+ "Marker": "LQ=="
+ },
+ "Children": [
+ {
+ "ID": "20260920131944-r4of7c6",
+ "Type": "NodeParagraph",
+ "Properties": {
+ "id": "20260920131944-r4of7c6",
+ "updated": "20260920131944"
+ },
+ "Children": [
+ {
+ "Type": "NodeText",
+ "Data": "流程图"
+ }
+ ]
+ }
+ ]
+ },
+ {
+ "ID": "20260920131944-069ljx4",
+ "Type": "NodeListItem",
+ "Properties": {
+ "id": "20260920131944-069ljx4",
+ "updated": "20260920131944"
+ },
+ "ListData": {
+ "Typ": 0,
+ "BulletChar": 45,
+ "Marker": "LQ=="
+ },
+ "Children": [
+ {
+ "ID": "20260920131944-cedjykk",
+ "Type": "NodeParagraph",
+ "Properties": {
+ "id": "20260920131944-cedjykk",
+ "updated": "20260920131944"
+ },
+ "Children": [
+ {
+ "Type": "NodeText",
+ "Data": "时序图"
+ }
+ ]
+ }
+ ]
+ },
+ {
+ "ID": "20260920131944-5rmxq4m",
+ "Type": "NodeListItem",
+ "Properties": {
+ "id": "20260920131944-5rmxq4m",
+ "updated": "20260920131944"
+ },
+ "ListData": {
+ "Typ": 0,
+ "BulletChar": 45,
+ "Marker": "LQ=="
+ },
+ "Children": [
+ {
+ "ID": "20260920131944-k6v3n3w",
+ "Type": "NodeParagraph",
+ "Properties": {
+ "id": "20260920131944-k6v3n3w",
+ "updated": "20260920131944"
+ },
+ "Children": [
+ {
+ "Type": "NodeText",
+ "Data": "甘特图"
+ }
+ ]
+ }
+ ]
+ },
+ {
+ "ID": "20260920131944-8p9cwfb",
+ "Type": "NodeListItem",
+ "Properties": {
+ "id": "20260920131944-8p9cwfb",
+ "updated": "20260920131944"
+ },
+ "ListData": {
+ "Typ": 0,
+ "BulletChar": 45,
+ "Marker": "LQ=="
+ },
+ "Children": [
+ {
+ "ID": "20260920131944-pkduvc7",
+ "Type": "NodeParagraph",
+ "Properties": {
+ "id": "20260920131944-pkduvc7",
+ "updated": "20260920131944"
+ },
+ "Children": [
+ {
+ "Type": "NodeText",
+ "Data": "图表"
+ }
+ ]
+ }
+ ]
+ },
+ {
+ "ID": "20260920131944-pdtm5pu",
+ "Type": "NodeListItem",
+ "Properties": {
+ "id": "20260920131944-pdtm5pu",
+ "updated": "20260920131944"
+ },
+ "ListData": {
+ "Typ": 0,
+ "BulletChar": 45,
+ "Marker": "LQ=="
+ },
+ "Children": [
+ {
+ "ID": "20260920131944-vdok17x",
+ "Type": "NodeParagraph",
+ "Properties": {
+ "id": "20260920131944-vdok17x",
+ "updated": "20260920131944"
+ },
+ "Children": [
+ {
+ "Type": "NodeText",
+ "Data": "五线谱"
+ }
+ ]
+ }
+ ]
+ },
+ {
+ "ID": "20260920131944-211vkor",
+ "Type": "NodeListItem",
+ "Properties": {
+ "id": "20260920131944-211vkor",
+ "updated": "20260920131944"
+ },
+ "ListData": {
+ "Typ": 0,
+ "BulletChar": 45,
+ "Marker": "LQ=="
+ },
+ "Children": [
+ {
+ "ID": "20260920131944-1po9218",
+ "Type": "NodeParagraph",
+ "Properties": {
+ "id": "20260920131944-1po9218",
+ "updated": "20260920131944"
+ },
+ "Children": [
+ {
+ "Type": "NodeText",
+ "Data": "Graphviz"
+ }
+ ]
+ }
+ ]
+ },
+ {
+ "ID": "20260920131944-fm0340i",
+ "Type": "NodeListItem",
+ "Properties": {
+ "id": "20260920131944-fm0340i",
+ "updated": "20260920131944"
+ },
+ "ListData": {
+ "Typ": 0,
+ "BulletChar": 45,
+ "Marker": "LQ=="
+ },
+ "Children": [
+ {
+ "ID": "20260920131944-sj2rcm0",
+ "Type": "NodeParagraph",
+ "Properties": {
+ "id": "20260920131944-sj2rcm0",
+ "updated": "20260920131944"
+ },
+ "Children": [
+ {
+ "Type": "NodeText",
+ "Data": "多媒体"
+ }
+ ]
+ }
+ ]
+ },
+ {
+ "ID": "20260920131944-wtc87gg",
+ "Type": "NodeListItem",
+ "Properties": {
+ "id": "20260920131944-wtc87gg",
+ "updated": "20260920131944"
+ },
+ "ListData": {
+ "Typ": 0,
+ "BulletChar": 45,
+ "Marker": "LQ=="
+ },
+ "Children": [
+ {
+ "ID": "20260920131944-mm6sv9w",
+ "Type": "NodeParagraph",
+ "Properties": {
+ "id": "20260920131944-mm6sv9w",
+ "updated": "20260920131944"
+ },
+ "Children": [
+ {
+ "Type": "NodeText",
+ "Data": "脚注"
+ }
+ ]
+ }
+ ]
+ }
+ ]
+ }
+ ]
+ },
+ {
+ "ID": "20260920131944-z3aukcp",
+ "Type": "NodeListItem",
+ "Properties": {
+ "id": "20260920131944-z3aukcp",
+ "updated": "20260920131944"
+ },
+ "ListData": {
+ "Typ": 0,
+ "BulletChar": 45,
+ "Marker": "LQ=="
+ },
+ "Children": [
+ {
+ "ID": "20260920131944-us7ltsd",
+ "Type": "NodeParagraph",
+ "Properties": {
+ "id": "20260920131944-us7ltsd",
+ "updated": "20260920131944"
+ },
+ "Children": [
+ {
+ "Type": "NodeText",
+ "Data": "快捷键"
+ }
+ ]
+ }
+ ]
}
]
},
@@ -2990,12 +4114,12 @@
"Type": "NodeParagraph",
"Properties": {
"id": "20211213122456-r9r9njg",
- "updated": "20211213122523"
+ "updated": "20260920131944"
},
"Children": [
{
"Type": "NodeText",
- "Data": "使用 Markdown 列表语法渲染脑图。"
+ "Data": "通过斜杠菜单新建脑图,或将列表块切换为脑图视图。打开可编辑文档时,旧脑图会自动转换为列表脑图,保留块 ID 和内容,支持撤销及文档历史恢复。无法完整转换的内容保留并显示源码。只读视图和导出仅转换显示,不修改原文档。"
}
]
},
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 af477a40dd..d85caa0e6c 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": "20260910080119"
+ "updated": "20260920131944"
},
"Children": [
{
@@ -2938,7 +2938,7 @@
"HeadingLevel": 2,
"Properties": {
"id": "20211226122008-731sqd6",
- "updated": "20211226122008"
+ "updated": "20260920131944"
},
"Children": [
{
@@ -2949,32 +2949,1162 @@
},
{
"ID": "20211226122122-jf2d7wf",
- "Type": "NodeCodeBlock",
- "IsFencedCodeBlock": true,
+ "Type": "NodeList",
"Properties": {
"id": "20211226122122-jf2d7wf",
- "updated": "20211228135857"
+ "updated": "20260920131944",
+ "custom-sy-list-mindmap": "1",
+ "custom-sy-list-mindmap-data": "{\"version\":1,\"nodes\":{},\"relations\":[]}"
+ },
+ "ListData": {
+ "Typ": 0,
+ "Tight": true,
+ "BulletChar": 45,
+ "Marker": "LQ=="
},
"Children": [
{
- "Type": "NodeCodeBlockFenceOpenMarker",
- "Data": "```"
- },
- {
- "Type": "NodeCodeBlockFenceInfoMarker",
- "CodeBlockInfo": "bWluZG1hcA=="
- },
- {
- "ID": "20220307092237-4jcq3tq",
- "Type": "NodeCodeBlockCode",
- "Data": "- 教程\n- 語法指導\n - 普通內容\n - 提及用戶\n - 表情符號 Emoji\n - 一些表情例子\n - 大標題 - Heading 3\n - Heading 4\n - Heading 5\n - Heading 6\n - 圖片\n - 代碼區塊\n - 普通\n - 語法突顯支援\n - 展示 Go 代碼突顯\n - 展示 Java 突顯\n - 有序、無序、任務列表\n - 無序列表\n - 有序列表\n - 任務列表\n - 表格\n - 隱藏細節\n - 段落\n - 連結引用\n - 數學公式\n - 心智圖\n - 流程圖\n - 時序圖\n - 甘特圖\n - 圖表\n - 五線譜\n - Graphviz\n - 多媒體\n - 註腳\n- 快捷鍵",
+ "ID": "20260920131944-6zykmiw",
+ "Type": "NodeListItem",
"Properties": {
- "id": "20220307092237-4jcq3tq"
- }
+ "id": "20260920131944-6zykmiw",
+ "updated": "20260920131944"
+ },
+ "ListData": {
+ "Typ": 0,
+ "BulletChar": 45,
+ "Marker": "LQ=="
+ },
+ "Children": [
+ {
+ "ID": "20260920131944-ami5lo8",
+ "Type": "NodeParagraph",
+ "Properties": {
+ "id": "20260920131944-ami5lo8",
+ "updated": "20260920131944"
+ },
+ "Children": [
+ {
+ "Type": "NodeText",
+ "Data": "教程"
+ }
+ ]
+ }
+ ]
},
{
- "Type": "NodeCodeBlockFenceCloseMarker",
- "Data": "```"
+ "ID": "20260920131944-2itv9c5",
+ "Type": "NodeListItem",
+ "Properties": {
+ "id": "20260920131944-2itv9c5",
+ "updated": "20260920131944"
+ },
+ "ListData": {
+ "Typ": 0,
+ "BulletChar": 45,
+ "Marker": "LQ=="
+ },
+ "Children": [
+ {
+ "ID": "20260920131944-b7l4svy",
+ "Type": "NodeParagraph",
+ "Properties": {
+ "id": "20260920131944-b7l4svy",
+ "updated": "20260920131944"
+ },
+ "Children": [
+ {
+ "Type": "NodeText",
+ "Data": "語法指導"
+ }
+ ]
+ },
+ {
+ "ID": "20260920131944-v7w5fjh",
+ "Type": "NodeList",
+ "Properties": {
+ "id": "20260920131944-v7w5fjh",
+ "updated": "20260920131944"
+ },
+ "ListData": {
+ "Typ": 0,
+ "Tight": true,
+ "BulletChar": 45,
+ "Marker": "LQ=="
+ },
+ "Children": [
+ {
+ "ID": "20260920131944-r2300x0",
+ "Type": "NodeListItem",
+ "Properties": {
+ "id": "20260920131944-r2300x0",
+ "updated": "20260920131944"
+ },
+ "ListData": {
+ "Typ": 0,
+ "BulletChar": 45,
+ "Marker": "LQ=="
+ },
+ "Children": [
+ {
+ "ID": "20260920131944-cad16n2",
+ "Type": "NodeParagraph",
+ "Properties": {
+ "id": "20260920131944-cad16n2",
+ "updated": "20260920131944"
+ },
+ "Children": [
+ {
+ "Type": "NodeText",
+ "Data": "普通內容"
+ }
+ ]
+ }
+ ]
+ },
+ {
+ "ID": "20260920131944-t3ot44v",
+ "Type": "NodeListItem",
+ "Properties": {
+ "id": "20260920131944-t3ot44v",
+ "updated": "20260920131944"
+ },
+ "ListData": {
+ "Typ": 0,
+ "BulletChar": 45,
+ "Marker": "LQ=="
+ },
+ "Children": [
+ {
+ "ID": "20260920131944-kxcbd2m",
+ "Type": "NodeParagraph",
+ "Properties": {
+ "id": "20260920131944-kxcbd2m",
+ "updated": "20260920131944"
+ },
+ "Children": [
+ {
+ "Type": "NodeText",
+ "Data": "提及用戶"
+ }
+ ]
+ }
+ ]
+ },
+ {
+ "ID": "20260920131944-kf0jukv",
+ "Type": "NodeListItem",
+ "Properties": {
+ "id": "20260920131944-kf0jukv",
+ "updated": "20260920131944"
+ },
+ "ListData": {
+ "Typ": 0,
+ "BulletChar": 45,
+ "Marker": "LQ=="
+ },
+ "Children": [
+ {
+ "ID": "20260920131944-ezi317i",
+ "Type": "NodeParagraph",
+ "Properties": {
+ "id": "20260920131944-ezi317i",
+ "updated": "20260920131944"
+ },
+ "Children": [
+ {
+ "Type": "NodeText",
+ "Data": "表情符號 Emoji"
+ }
+ ]
+ },
+ {
+ "ID": "20260920131944-ts9c8ff",
+ "Type": "NodeList",
+ "Properties": {
+ "id": "20260920131944-ts9c8ff",
+ "updated": "20260920131944"
+ },
+ "ListData": {
+ "Typ": 0,
+ "Tight": true,
+ "BulletChar": 45,
+ "Marker": "LQ=="
+ },
+ "Children": [
+ {
+ "ID": "20260920131944-rmpzsmn",
+ "Type": "NodeListItem",
+ "Properties": {
+ "id": "20260920131944-rmpzsmn",
+ "updated": "20260920131944"
+ },
+ "ListData": {
+ "Typ": 0,
+ "BulletChar": 45,
+ "Marker": "LQ=="
+ },
+ "Children": [
+ {
+ "ID": "20260920131944-frlgn7w",
+ "Type": "NodeParagraph",
+ "Properties": {
+ "id": "20260920131944-frlgn7w",
+ "updated": "20260920131944"
+ },
+ "Children": [
+ {
+ "Type": "NodeText",
+ "Data": "一些表情例子"
+ }
+ ]
+ }
+ ]
+ }
+ ]
+ }
+ ]
+ },
+ {
+ "ID": "20260920131944-hfeeycf",
+ "Type": "NodeListItem",
+ "Properties": {
+ "id": "20260920131944-hfeeycf",
+ "updated": "20260920131944"
+ },
+ "ListData": {
+ "Typ": 0,
+ "BulletChar": 45,
+ "Marker": "LQ=="
+ },
+ "Children": [
+ {
+ "ID": "20260920131944-ub5bgqa",
+ "Type": "NodeParagraph",
+ "Properties": {
+ "id": "20260920131944-ub5bgqa",
+ "updated": "20260920131944"
+ },
+ "Children": [
+ {
+ "Type": "NodeText",
+ "Data": "大標題 - Heading 3"
+ }
+ ]
+ },
+ {
+ "ID": "20260920131944-mezxsci",
+ "Type": "NodeList",
+ "Properties": {
+ "id": "20260920131944-mezxsci",
+ "updated": "20260920131944"
+ },
+ "ListData": {
+ "Typ": 0,
+ "Tight": true,
+ "BulletChar": 45,
+ "Marker": "LQ=="
+ },
+ "Children": [
+ {
+ "ID": "20260920131944-m7wv5sn",
+ "Type": "NodeListItem",
+ "Properties": {
+ "id": "20260920131944-m7wv5sn",
+ "updated": "20260920131944"
+ },
+ "ListData": {
+ "Typ": 0,
+ "BulletChar": 45,
+ "Marker": "LQ=="
+ },
+ "Children": [
+ {
+ "ID": "20260920131944-t4e383k",
+ "Type": "NodeParagraph",
+ "Properties": {
+ "id": "20260920131944-t4e383k",
+ "updated": "20260920131944"
+ },
+ "Children": [
+ {
+ "Type": "NodeText",
+ "Data": "Heading 4"
+ }
+ ]
+ },
+ {
+ "ID": "20260920131944-g8201d4",
+ "Type": "NodeList",
+ "Properties": {
+ "id": "20260920131944-g8201d4",
+ "updated": "20260920131944"
+ },
+ "ListData": {
+ "Typ": 0,
+ "Tight": true,
+ "BulletChar": 45,
+ "Marker": "LQ=="
+ },
+ "Children": [
+ {
+ "ID": "20260920131944-lb6yz35",
+ "Type": "NodeListItem",
+ "Properties": {
+ "id": "20260920131944-lb6yz35",
+ "updated": "20260920131944"
+ },
+ "ListData": {
+ "Typ": 0,
+ "BulletChar": 45,
+ "Marker": "LQ=="
+ },
+ "Children": [
+ {
+ "ID": "20260920131944-3r5pper",
+ "Type": "NodeParagraph",
+ "Properties": {
+ "id": "20260920131944-3r5pper",
+ "updated": "20260920131944"
+ },
+ "Children": [
+ {
+ "Type": "NodeText",
+ "Data": "Heading 5"
+ }
+ ]
+ },
+ {
+ "ID": "20260920131944-3i9fxai",
+ "Type": "NodeList",
+ "Properties": {
+ "id": "20260920131944-3i9fxai",
+ "updated": "20260920131944"
+ },
+ "ListData": {
+ "Typ": 0,
+ "Tight": true,
+ "BulletChar": 45,
+ "Marker": "LQ=="
+ },
+ "Children": [
+ {
+ "ID": "20260920131944-l8hrs29",
+ "Type": "NodeListItem",
+ "Properties": {
+ "id": "20260920131944-l8hrs29",
+ "updated": "20260920131944"
+ },
+ "ListData": {
+ "Typ": 0,
+ "BulletChar": 45,
+ "Marker": "LQ=="
+ },
+ "Children": [
+ {
+ "ID": "20260920131944-w5rd3r5",
+ "Type": "NodeParagraph",
+ "Properties": {
+ "id": "20260920131944-w5rd3r5",
+ "updated": "20260920131944"
+ },
+ "Children": [
+ {
+ "Type": "NodeText",
+ "Data": "Heading 6"
+ }
+ ]
+ }
+ ]
+ }
+ ]
+ }
+ ]
+ }
+ ]
+ }
+ ]
+ }
+ ]
+ }
+ ]
+ },
+ {
+ "ID": "20260920131944-hf9qhfm",
+ "Type": "NodeListItem",
+ "Properties": {
+ "id": "20260920131944-hf9qhfm",
+ "updated": "20260920131944"
+ },
+ "ListData": {
+ "Typ": 0,
+ "BulletChar": 45,
+ "Marker": "LQ=="
+ },
+ "Children": [
+ {
+ "ID": "20260920131944-ew4xkam",
+ "Type": "NodeParagraph",
+ "Properties": {
+ "id": "20260920131944-ew4xkam",
+ "updated": "20260920131944"
+ },
+ "Children": [
+ {
+ "Type": "NodeText",
+ "Data": "圖片"
+ }
+ ]
+ }
+ ]
+ },
+ {
+ "ID": "20260920131944-yg599ph",
+ "Type": "NodeListItem",
+ "Properties": {
+ "id": "20260920131944-yg599ph",
+ "updated": "20260920131944"
+ },
+ "ListData": {
+ "Typ": 0,
+ "BulletChar": 45,
+ "Marker": "LQ=="
+ },
+ "Children": [
+ {
+ "ID": "20260920131944-abgz1v3",
+ "Type": "NodeParagraph",
+ "Properties": {
+ "id": "20260920131944-abgz1v3",
+ "updated": "20260920131944"
+ },
+ "Children": [
+ {
+ "Type": "NodeText",
+ "Data": "代碼區塊"
+ }
+ ]
+ },
+ {
+ "ID": "20260920131944-hmz332k",
+ "Type": "NodeList",
+ "Properties": {
+ "id": "20260920131944-hmz332k",
+ "updated": "20260920131944"
+ },
+ "ListData": {
+ "Typ": 0,
+ "Tight": true,
+ "BulletChar": 45,
+ "Marker": "LQ=="
+ },
+ "Children": [
+ {
+ "ID": "20260920131944-nbnv3x5",
+ "Type": "NodeListItem",
+ "Properties": {
+ "id": "20260920131944-nbnv3x5",
+ "updated": "20260920131944"
+ },
+ "ListData": {
+ "Typ": 0,
+ "BulletChar": 45,
+ "Marker": "LQ=="
+ },
+ "Children": [
+ {
+ "ID": "20260920131944-yclpw6r",
+ "Type": "NodeParagraph",
+ "Properties": {
+ "id": "20260920131944-yclpw6r",
+ "updated": "20260920131944"
+ },
+ "Children": [
+ {
+ "Type": "NodeText",
+ "Data": "普通"
+ }
+ ]
+ }
+ ]
+ },
+ {
+ "ID": "20260920131944-2rtirbz",
+ "Type": "NodeListItem",
+ "Properties": {
+ "id": "20260920131944-2rtirbz",
+ "updated": "20260920131944"
+ },
+ "ListData": {
+ "Typ": 0,
+ "BulletChar": 45,
+ "Marker": "LQ=="
+ },
+ "Children": [
+ {
+ "ID": "20260920131944-14o04gz",
+ "Type": "NodeParagraph",
+ "Properties": {
+ "id": "20260920131944-14o04gz",
+ "updated": "20260920131944"
+ },
+ "Children": [
+ {
+ "Type": "NodeText",
+ "Data": "語法突顯支援"
+ }
+ ]
+ },
+ {
+ "ID": "20260920131944-1u1w8jo",
+ "Type": "NodeList",
+ "Properties": {
+ "id": "20260920131944-1u1w8jo",
+ "updated": "20260920131944"
+ },
+ "ListData": {
+ "Typ": 0,
+ "Tight": true,
+ "BulletChar": 45,
+ "Marker": "LQ=="
+ },
+ "Children": [
+ {
+ "ID": "20260920131944-6dmgan1",
+ "Type": "NodeListItem",
+ "Properties": {
+ "id": "20260920131944-6dmgan1",
+ "updated": "20260920131944"
+ },
+ "ListData": {
+ "Typ": 0,
+ "BulletChar": 45,
+ "Marker": "LQ=="
+ },
+ "Children": [
+ {
+ "ID": "20260920131944-9c33xs8",
+ "Type": "NodeParagraph",
+ "Properties": {
+ "id": "20260920131944-9c33xs8",
+ "updated": "20260920131944"
+ },
+ "Children": [
+ {
+ "Type": "NodeText",
+ "Data": "展示 Go 代碼突顯"
+ }
+ ]
+ }
+ ]
+ },
+ {
+ "ID": "20260920131944-uvlxqwj",
+ "Type": "NodeListItem",
+ "Properties": {
+ "id": "20260920131944-uvlxqwj",
+ "updated": "20260920131944"
+ },
+ "ListData": {
+ "Typ": 0,
+ "BulletChar": 45,
+ "Marker": "LQ=="
+ },
+ "Children": [
+ {
+ "ID": "20260920131944-7vh3jf5",
+ "Type": "NodeParagraph",
+ "Properties": {
+ "id": "20260920131944-7vh3jf5",
+ "updated": "20260920131944"
+ },
+ "Children": [
+ {
+ "Type": "NodeText",
+ "Data": "展示 Java 突顯"
+ }
+ ]
+ }
+ ]
+ }
+ ]
+ }
+ ]
+ }
+ ]
+ }
+ ]
+ },
+ {
+ "ID": "20260920131944-3ki1jbt",
+ "Type": "NodeListItem",
+ "Properties": {
+ "id": "20260920131944-3ki1jbt",
+ "updated": "20260920131944"
+ },
+ "ListData": {
+ "Typ": 0,
+ "BulletChar": 45,
+ "Marker": "LQ=="
+ },
+ "Children": [
+ {
+ "ID": "20260920131944-vsec82o",
+ "Type": "NodeParagraph",
+ "Properties": {
+ "id": "20260920131944-vsec82o",
+ "updated": "20260920131944"
+ },
+ "Children": [
+ {
+ "Type": "NodeText",
+ "Data": "有序、無序、任務列表"
+ }
+ ]
+ },
+ {
+ "ID": "20260920131944-58wujs6",
+ "Type": "NodeList",
+ "Properties": {
+ "id": "20260920131944-58wujs6",
+ "updated": "20260920131944"
+ },
+ "ListData": {
+ "Typ": 0,
+ "Tight": true,
+ "BulletChar": 45,
+ "Marker": "LQ=="
+ },
+ "Children": [
+ {
+ "ID": "20260920131944-cw5ora5",
+ "Type": "NodeListItem",
+ "Properties": {
+ "id": "20260920131944-cw5ora5",
+ "updated": "20260920131944"
+ },
+ "ListData": {
+ "Typ": 0,
+ "BulletChar": 45,
+ "Marker": "LQ=="
+ },
+ "Children": [
+ {
+ "ID": "20260920131944-7nlnx2y",
+ "Type": "NodeParagraph",
+ "Properties": {
+ "id": "20260920131944-7nlnx2y",
+ "updated": "20260920131944"
+ },
+ "Children": [
+ {
+ "Type": "NodeText",
+ "Data": "無序列表"
+ }
+ ]
+ }
+ ]
+ },
+ {
+ "ID": "20260920131944-s8w0v8v",
+ "Type": "NodeListItem",
+ "Properties": {
+ "id": "20260920131944-s8w0v8v",
+ "updated": "20260920131944"
+ },
+ "ListData": {
+ "Typ": 0,
+ "BulletChar": 45,
+ "Marker": "LQ=="
+ },
+ "Children": [
+ {
+ "ID": "20260920131944-2fbl1eq",
+ "Type": "NodeParagraph",
+ "Properties": {
+ "id": "20260920131944-2fbl1eq",
+ "updated": "20260920131944"
+ },
+ "Children": [
+ {
+ "Type": "NodeText",
+ "Data": "有序列表"
+ }
+ ]
+ }
+ ]
+ },
+ {
+ "ID": "20260920131944-sgyab4r",
+ "Type": "NodeListItem",
+ "Properties": {
+ "id": "20260920131944-sgyab4r",
+ "updated": "20260920131944"
+ },
+ "ListData": {
+ "Typ": 0,
+ "BulletChar": 45,
+ "Marker": "LQ=="
+ },
+ "Children": [
+ {
+ "ID": "20260920131944-zw4sm49",
+ "Type": "NodeParagraph",
+ "Properties": {
+ "id": "20260920131944-zw4sm49",
+ "updated": "20260920131944"
+ },
+ "Children": [
+ {
+ "Type": "NodeText",
+ "Data": "任務列表"
+ }
+ ]
+ }
+ ]
+ }
+ ]
+ }
+ ]
+ },
+ {
+ "ID": "20260920131944-0drkjbn",
+ "Type": "NodeListItem",
+ "Properties": {
+ "id": "20260920131944-0drkjbn",
+ "updated": "20260920131944"
+ },
+ "ListData": {
+ "Typ": 0,
+ "BulletChar": 45,
+ "Marker": "LQ=="
+ },
+ "Children": [
+ {
+ "ID": "20260920131944-dd8kyou",
+ "Type": "NodeParagraph",
+ "Properties": {
+ "id": "20260920131944-dd8kyou",
+ "updated": "20260920131944"
+ },
+ "Children": [
+ {
+ "Type": "NodeText",
+ "Data": "表格"
+ }
+ ]
+ }
+ ]
+ },
+ {
+ "ID": "20260920131944-iex52td",
+ "Type": "NodeListItem",
+ "Properties": {
+ "id": "20260920131944-iex52td",
+ "updated": "20260920131944"
+ },
+ "ListData": {
+ "Typ": 0,
+ "BulletChar": 45,
+ "Marker": "LQ=="
+ },
+ "Children": [
+ {
+ "ID": "20260920131944-kci2zk7",
+ "Type": "NodeParagraph",
+ "Properties": {
+ "id": "20260920131944-kci2zk7",
+ "updated": "20260920131944"
+ },
+ "Children": [
+ {
+ "Type": "NodeText",
+ "Data": "隱藏細節"
+ }
+ ]
+ }
+ ]
+ },
+ {
+ "ID": "20260920131944-cy8zgot",
+ "Type": "NodeListItem",
+ "Properties": {
+ "id": "20260920131944-cy8zgot",
+ "updated": "20260920131944"
+ },
+ "ListData": {
+ "Typ": 0,
+ "BulletChar": 45,
+ "Marker": "LQ=="
+ },
+ "Children": [
+ {
+ "ID": "20260920131944-7nqti6n",
+ "Type": "NodeParagraph",
+ "Properties": {
+ "id": "20260920131944-7nqti6n",
+ "updated": "20260920131944"
+ },
+ "Children": [
+ {
+ "Type": "NodeText",
+ "Data": "段落"
+ }
+ ]
+ }
+ ]
+ },
+ {
+ "ID": "20260920131944-5h8bcih",
+ "Type": "NodeListItem",
+ "Properties": {
+ "id": "20260920131944-5h8bcih",
+ "updated": "20260920131944"
+ },
+ "ListData": {
+ "Typ": 0,
+ "BulletChar": 45,
+ "Marker": "LQ=="
+ },
+ "Children": [
+ {
+ "ID": "20260920131944-qynq3m0",
+ "Type": "NodeParagraph",
+ "Properties": {
+ "id": "20260920131944-qynq3m0",
+ "updated": "20260920131944"
+ },
+ "Children": [
+ {
+ "Type": "NodeText",
+ "Data": "連結引用"
+ }
+ ]
+ }
+ ]
+ },
+ {
+ "ID": "20260920131944-2rfccwu",
+ "Type": "NodeListItem",
+ "Properties": {
+ "id": "20260920131944-2rfccwu",
+ "updated": "20260920131944"
+ },
+ "ListData": {
+ "Typ": 0,
+ "BulletChar": 45,
+ "Marker": "LQ=="
+ },
+ "Children": [
+ {
+ "ID": "20260920131944-dluljqm",
+ "Type": "NodeParagraph",
+ "Properties": {
+ "id": "20260920131944-dluljqm",
+ "updated": "20260920131944"
+ },
+ "Children": [
+ {
+ "Type": "NodeText",
+ "Data": "數學公式"
+ }
+ ]
+ }
+ ]
+ },
+ {
+ "ID": "20260920131944-triytyh",
+ "Type": "NodeListItem",
+ "Properties": {
+ "id": "20260920131944-triytyh",
+ "updated": "20260920131944"
+ },
+ "ListData": {
+ "Typ": 0,
+ "BulletChar": 45,
+ "Marker": "LQ=="
+ },
+ "Children": [
+ {
+ "ID": "20260920131944-ltbxiyr",
+ "Type": "NodeParagraph",
+ "Properties": {
+ "id": "20260920131944-ltbxiyr",
+ "updated": "20260920131944"
+ },
+ "Children": [
+ {
+ "Type": "NodeText",
+ "Data": "心智圖"
+ }
+ ]
+ }
+ ]
+ },
+ {
+ "ID": "20260920131944-hwbyxft",
+ "Type": "NodeListItem",
+ "Properties": {
+ "id": "20260920131944-hwbyxft",
+ "updated": "20260920131944"
+ },
+ "ListData": {
+ "Typ": 0,
+ "BulletChar": 45,
+ "Marker": "LQ=="
+ },
+ "Children": [
+ {
+ "ID": "20260920131944-usoesx3",
+ "Type": "NodeParagraph",
+ "Properties": {
+ "id": "20260920131944-usoesx3",
+ "updated": "20260920131944"
+ },
+ "Children": [
+ {
+ "Type": "NodeText",
+ "Data": "流程圖"
+ }
+ ]
+ }
+ ]
+ },
+ {
+ "ID": "20260920131944-z09ka6r",
+ "Type": "NodeListItem",
+ "Properties": {
+ "id": "20260920131944-z09ka6r",
+ "updated": "20260920131944"
+ },
+ "ListData": {
+ "Typ": 0,
+ "BulletChar": 45,
+ "Marker": "LQ=="
+ },
+ "Children": [
+ {
+ "ID": "20260920131944-7k0s7ew",
+ "Type": "NodeParagraph",
+ "Properties": {
+ "id": "20260920131944-7k0s7ew",
+ "updated": "20260920131944"
+ },
+ "Children": [
+ {
+ "Type": "NodeText",
+ "Data": "時序圖"
+ }
+ ]
+ }
+ ]
+ },
+ {
+ "ID": "20260920131944-pv5eqru",
+ "Type": "NodeListItem",
+ "Properties": {
+ "id": "20260920131944-pv5eqru",
+ "updated": "20260920131944"
+ },
+ "ListData": {
+ "Typ": 0,
+ "BulletChar": 45,
+ "Marker": "LQ=="
+ },
+ "Children": [
+ {
+ "ID": "20260920131944-7ss5jx1",
+ "Type": "NodeParagraph",
+ "Properties": {
+ "id": "20260920131944-7ss5jx1",
+ "updated": "20260920131944"
+ },
+ "Children": [
+ {
+ "Type": "NodeText",
+ "Data": "甘特圖"
+ }
+ ]
+ }
+ ]
+ },
+ {
+ "ID": "20260920131944-2hyqlw9",
+ "Type": "NodeListItem",
+ "Properties": {
+ "id": "20260920131944-2hyqlw9",
+ "updated": "20260920131944"
+ },
+ "ListData": {
+ "Typ": 0,
+ "BulletChar": 45,
+ "Marker": "LQ=="
+ },
+ "Children": [
+ {
+ "ID": "20260920131944-dnyt6vp",
+ "Type": "NodeParagraph",
+ "Properties": {
+ "id": "20260920131944-dnyt6vp",
+ "updated": "20260920131944"
+ },
+ "Children": [
+ {
+ "Type": "NodeText",
+ "Data": "圖表"
+ }
+ ]
+ }
+ ]
+ },
+ {
+ "ID": "20260920131944-qhb9hfq",
+ "Type": "NodeListItem",
+ "Properties": {
+ "id": "20260920131944-qhb9hfq",
+ "updated": "20260920131944"
+ },
+ "ListData": {
+ "Typ": 0,
+ "BulletChar": 45,
+ "Marker": "LQ=="
+ },
+ "Children": [
+ {
+ "ID": "20260920131944-gulp639",
+ "Type": "NodeParagraph",
+ "Properties": {
+ "id": "20260920131944-gulp639",
+ "updated": "20260920131944"
+ },
+ "Children": [
+ {
+ "Type": "NodeText",
+ "Data": "五線譜"
+ }
+ ]
+ }
+ ]
+ },
+ {
+ "ID": "20260920131944-7quo0dj",
+ "Type": "NodeListItem",
+ "Properties": {
+ "id": "20260920131944-7quo0dj",
+ "updated": "20260920131944"
+ },
+ "ListData": {
+ "Typ": 0,
+ "BulletChar": 45,
+ "Marker": "LQ=="
+ },
+ "Children": [
+ {
+ "ID": "20260920131944-tv9u9h6",
+ "Type": "NodeParagraph",
+ "Properties": {
+ "id": "20260920131944-tv9u9h6",
+ "updated": "20260920131944"
+ },
+ "Children": [
+ {
+ "Type": "NodeText",
+ "Data": "Graphviz"
+ }
+ ]
+ }
+ ]
+ },
+ {
+ "ID": "20260920131944-iwyk9e0",
+ "Type": "NodeListItem",
+ "Properties": {
+ "id": "20260920131944-iwyk9e0",
+ "updated": "20260920131944"
+ },
+ "ListData": {
+ "Typ": 0,
+ "BulletChar": 45,
+ "Marker": "LQ=="
+ },
+ "Children": [
+ {
+ "ID": "20260920131944-e22z911",
+ "Type": "NodeParagraph",
+ "Properties": {
+ "id": "20260920131944-e22z911",
+ "updated": "20260920131944"
+ },
+ "Children": [
+ {
+ "Type": "NodeText",
+ "Data": "多媒體"
+ }
+ ]
+ }
+ ]
+ },
+ {
+ "ID": "20260920131944-vmzubh2",
+ "Type": "NodeListItem",
+ "Properties": {
+ "id": "20260920131944-vmzubh2",
+ "updated": "20260920131944"
+ },
+ "ListData": {
+ "Typ": 0,
+ "BulletChar": 45,
+ "Marker": "LQ=="
+ },
+ "Children": [
+ {
+ "ID": "20260920131944-n8e1lve",
+ "Type": "NodeParagraph",
+ "Properties": {
+ "id": "20260920131944-n8e1lve",
+ "updated": "20260920131944"
+ },
+ "Children": [
+ {
+ "Type": "NodeText",
+ "Data": "註腳"
+ }
+ ]
+ }
+ ]
+ }
+ ]
+ }
+ ]
+ },
+ {
+ "ID": "20260920131944-ilg5sz3",
+ "Type": "NodeListItem",
+ "Properties": {
+ "id": "20260920131944-ilg5sz3",
+ "updated": "20260920131944"
+ },
+ "ListData": {
+ "Typ": 0,
+ "BulletChar": 45,
+ "Marker": "LQ=="
+ },
+ "Children": [
+ {
+ "ID": "20260920131944-w4myf3y",
+ "Type": "NodeParagraph",
+ "Properties": {
+ "id": "20260920131944-w4myf3y",
+ "updated": "20260920131944"
+ },
+ "Children": [
+ {
+ "Type": "NodeText",
+ "Data": "快捷鍵"
+ }
+ ]
+ }
+ ]
}
]
},
@@ -2983,12 +4113,12 @@
"Type": "NodeParagraph",
"Properties": {
"id": "20211226122008-fd4y9qu",
- "updated": "20211226002353"
+ "updated": "20260920131944"
},
"Children": [
{
"Type": "NodeText",
- "Data": "使用 Markdown 列表語法渲染心智圖。"
+ "Data": "透過斜線選單建立心智圖,或將清單區塊切換為心智圖視圖。開啟可編輯文件時,舊心智圖會自動轉換為清單心智圖,保留區塊 ID 和內容,支援復原及文件歷史還原。無法完整轉換的內容會保留並顯示原始碼。唯讀視圖和匯出僅轉換顯示,不修改原始文件。"
}
]
},
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 2951a59d16..4766ac7d90 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": "20260910080119"
+ "updated": "20260920131944"
},
"Children": [
{
@@ -3116,7 +3116,7 @@
"Properties": {
"ID": "20240530101000-ch5e4vh",
"id": "20240530101000-1ev7xub",
- "updated": "20240530101000"
+ "updated": "20260920131944"
},
"Children": [
{
@@ -3127,56 +3127,1178 @@
},
{
"ID": "20240530101000-lrwpxpq",
- "Type": "NodeCodeBlock",
- "IsFencedCodeBlock": true,
- "CodeBlockFenceChar": 96,
- "CodeBlockFenceLen": 3,
- "CodeBlockOpenFence": "YGBg",
- "CodeBlockInfo": "bWluZG1hcA==",
- "CodeBlockCloseFence": "YGBg",
+ "Type": "NodeList",
"Properties": {
"ID": "20240530101000-xheni2b",
"id": "20240530101000-lrwpxpq",
- "updated": "20240530101000"
+ "updated": "20260920131944",
+ "custom-sy-list-mindmap": "1",
+ "custom-sy-list-mindmap-data": "{\"version\":1,\"nodes\":{},\"relations\":[]}"
+ },
+ "ListData": {
+ "Typ": 0,
+ "Tight": true,
+ "BulletChar": 45,
+ "Marker": "LQ=="
},
"Children": [
{
- "Type": "NodeCodeBlockFenceOpenMarker",
- "Data": "```",
- "CodeBlockFenceLen": 3
- },
- {
- "Type": "NodeCodeBlockFenceInfoMarker",
- "CodeBlockInfo": "bWluZG1hcA=="
- },
- {
- "ID": "20240530101000-gr0btu9",
- "Type": "NodeCodeBlockCode",
- "Data": "- Tutorial\n- Grammar guidance\n - General content\n - Mention users\n - Emoji\n - Some emoji examples\n - Heading-Heading 3\n - Heading 4\n - Heading 5\n - Heading 6\n - Picture\n - Code block\n - Normal\n - Syntax highlighting support\n - Demonstrate Go code highlighting\n - Demo Java highlighting\n - Ordered, disordered, task list\n - Unordered list\n - Ordered list\n - task list\n - Form\n - Hide details\n - Paragraph\n - Link reference\n - Mathematical formula\n - Mind Map\n - Flow chart\n - Timing diagram\n - Gantt chart\n - Chart\n - Staff\n - Graphviz\n - Multimedia\n - Footnote\n - Shortcuts\n",
+ "ID": "20260920131944-fxnbecl",
+ "Type": "NodeListItem",
"Properties": {
- "ID": "20240530101000-syxic32",
- "id": "20240530101000-gr0btu9"
- }
+ "id": "20260920131944-fxnbecl",
+ "updated": "20260920131944"
+ },
+ "ListData": {
+ "Typ": 0,
+ "BulletChar": 45,
+ "Marker": "LQ=="
+ },
+ "Children": [
+ {
+ "ID": "20260920131944-c2x53p3",
+ "Type": "NodeParagraph",
+ "Properties": {
+ "id": "20260920131944-c2x53p3",
+ "updated": "20260920131944"
+ },
+ "Children": [
+ {
+ "Type": "NodeText",
+ "Data": "Tutorial"
+ }
+ ]
+ }
+ ]
},
{
- "Type": "NodeCodeBlockFenceCloseMarker",
- "Data": "```",
- "CodeBlockFenceLen": 3
- }
- ]
- },
- {
- "ID": "20240530101000-qvuwb7d",
- "Type": "NodeParagraph",
- "Properties": {
- "ID": "20240530101000-ibiw8ul",
- "id": "20240530101000-qvuwb7d",
- "updated": "20240530101000"
+ "ID": "20260920131944-tivsbcd",
+ "Type": "NodeListItem",
+ "Properties": {
+ "id": "20260920131944-tivsbcd",
+ "updated": "20260920131944"
+ },
+ "ListData": {
+ "Typ": 0,
+ "BulletChar": 45,
+ "Marker": "LQ=="
+ },
+ "Children": [
+ {
+ "ID": "20260920131944-2cfagn6",
+ "Type": "NodeParagraph",
+ "Properties": {
+ "id": "20260920131944-2cfagn6",
+ "updated": "20260920131944"
+ },
+ "Children": [
+ {
+ "Type": "NodeText",
+ "Data": "Grammar guidance"
+ }
+ ]
+ },
+ {
+ "ID": "20260920131944-8lzxm29",
+ "Type": "NodeList",
+ "Properties": {
+ "id": "20260920131944-8lzxm29",
+ "updated": "20260920131944"
+ },
+ "ListData": {
+ "Typ": 0,
+ "Tight": true,
+ "BulletChar": 45,
+ "Marker": "LQ=="
+ },
+ "Children": [
+ {
+ "ID": "20260920131944-k7z53iz",
+ "Type": "NodeListItem",
+ "Properties": {
+ "id": "20260920131944-k7z53iz",
+ "updated": "20260920131944"
+ },
+ "ListData": {
+ "Typ": 0,
+ "BulletChar": 45,
+ "Marker": "LQ=="
+ },
+ "Children": [
+ {
+ "ID": "20260920131944-u942ce7",
+ "Type": "NodeParagraph",
+ "Properties": {
+ "id": "20260920131944-u942ce7",
+ "updated": "20260920131944"
+ },
+ "Children": [
+ {
+ "Type": "NodeText",
+ "Data": "General content"
+ }
+ ]
+ }
+ ]
+ },
+ {
+ "ID": "20260920131944-24y9af6",
+ "Type": "NodeListItem",
+ "Properties": {
+ "id": "20260920131944-24y9af6",
+ "updated": "20260920131944"
+ },
+ "ListData": {
+ "Typ": 0,
+ "BulletChar": 45,
+ "Marker": "LQ=="
+ },
+ "Children": [
+ {
+ "ID": "20260920131944-7vcaxzb",
+ "Type": "NodeParagraph",
+ "Properties": {
+ "id": "20260920131944-7vcaxzb",
+ "updated": "20260920131944"
+ },
+ "Children": [
+ {
+ "Type": "NodeText",
+ "Data": "Mention users"
+ }
+ ]
+ }
+ ]
+ },
+ {
+ "ID": "20260920131944-0d4drz3",
+ "Type": "NodeListItem",
+ "Properties": {
+ "id": "20260920131944-0d4drz3",
+ "updated": "20260920131944"
+ },
+ "ListData": {
+ "Typ": 0,
+ "BulletChar": 45,
+ "Marker": "LQ=="
+ },
+ "Children": [
+ {
+ "ID": "20260920131944-sb9orb2",
+ "Type": "NodeParagraph",
+ "Properties": {
+ "id": "20260920131944-sb9orb2",
+ "updated": "20260920131944"
+ },
+ "Children": [
+ {
+ "Type": "NodeText",
+ "Data": "Emoji"
+ }
+ ]
+ },
+ {
+ "ID": "20260920131944-xz2el6g",
+ "Type": "NodeList",
+ "Properties": {
+ "id": "20260920131944-xz2el6g",
+ "updated": "20260920131944"
+ },
+ "ListData": {
+ "Typ": 0,
+ "Tight": true,
+ "BulletChar": 45,
+ "Marker": "LQ=="
+ },
+ "Children": [
+ {
+ "ID": "20260920131944-zp3k4g1",
+ "Type": "NodeListItem",
+ "Properties": {
+ "id": "20260920131944-zp3k4g1",
+ "updated": "20260920131944"
+ },
+ "ListData": {
+ "Typ": 0,
+ "BulletChar": 45,
+ "Marker": "LQ=="
+ },
+ "Children": [
+ {
+ "ID": "20260920131944-ld40zmf",
+ "Type": "NodeParagraph",
+ "Properties": {
+ "id": "20260920131944-ld40zmf",
+ "updated": "20260920131944"
+ },
+ "Children": [
+ {
+ "Type": "NodeText",
+ "Data": "Some emoji examples"
+ }
+ ]
+ }
+ ]
+ }
+ ]
+ }
+ ]
+ },
+ {
+ "ID": "20260920131944-btnkm0h",
+ "Type": "NodeListItem",
+ "Properties": {
+ "id": "20260920131944-btnkm0h",
+ "updated": "20260920131944"
+ },
+ "ListData": {
+ "Typ": 0,
+ "BulletChar": 45,
+ "Marker": "LQ=="
+ },
+ "Children": [
+ {
+ "ID": "20260920131944-372ny2n",
+ "Type": "NodeParagraph",
+ "Properties": {
+ "id": "20260920131944-372ny2n",
+ "updated": "20260920131944"
+ },
+ "Children": [
+ {
+ "Type": "NodeText",
+ "Data": "Heading-Heading 3"
+ }
+ ]
+ },
+ {
+ "ID": "20260920131944-fx4s3uk",
+ "Type": "NodeList",
+ "Properties": {
+ "id": "20260920131944-fx4s3uk",
+ "updated": "20260920131944"
+ },
+ "ListData": {
+ "Typ": 0,
+ "Tight": true,
+ "BulletChar": 45,
+ "Marker": "LQ=="
+ },
+ "Children": [
+ {
+ "ID": "20260920131944-cerwn1v",
+ "Type": "NodeListItem",
+ "Properties": {
+ "id": "20260920131944-cerwn1v",
+ "updated": "20260920131944"
+ },
+ "ListData": {
+ "Typ": 0,
+ "BulletChar": 45,
+ "Marker": "LQ=="
+ },
+ "Children": [
+ {
+ "ID": "20260920131944-7f6n3gi",
+ "Type": "NodeParagraph",
+ "Properties": {
+ "id": "20260920131944-7f6n3gi",
+ "updated": "20260920131944"
+ },
+ "Children": [
+ {
+ "Type": "NodeText",
+ "Data": "Heading 4"
+ }
+ ]
+ },
+ {
+ "ID": "20260920131944-f1269cs",
+ "Type": "NodeList",
+ "Properties": {
+ "id": "20260920131944-f1269cs",
+ "updated": "20260920131944"
+ },
+ "ListData": {
+ "Typ": 0,
+ "Tight": true,
+ "BulletChar": 45,
+ "Marker": "LQ=="
+ },
+ "Children": [
+ {
+ "ID": "20260920131944-72s0v80",
+ "Type": "NodeListItem",
+ "Properties": {
+ "id": "20260920131944-72s0v80",
+ "updated": "20260920131944"
+ },
+ "ListData": {
+ "Typ": 0,
+ "BulletChar": 45,
+ "Marker": "LQ=="
+ },
+ "Children": [
+ {
+ "ID": "20260920131944-kg87f5c",
+ "Type": "NodeParagraph",
+ "Properties": {
+ "id": "20260920131944-kg87f5c",
+ "updated": "20260920131944"
+ },
+ "Children": [
+ {
+ "Type": "NodeText",
+ "Data": "Heading 5"
+ }
+ ]
+ },
+ {
+ "ID": "20260920131944-92l9ke8",
+ "Type": "NodeList",
+ "Properties": {
+ "id": "20260920131944-92l9ke8",
+ "updated": "20260920131944"
+ },
+ "ListData": {
+ "Typ": 0,
+ "Tight": true,
+ "BulletChar": 45,
+ "Marker": "LQ=="
+ },
+ "Children": [
+ {
+ "ID": "20260920131944-8x0hgje",
+ "Type": "NodeListItem",
+ "Properties": {
+ "id": "20260920131944-8x0hgje",
+ "updated": "20260920131944"
+ },
+ "ListData": {
+ "Typ": 0,
+ "BulletChar": 45,
+ "Marker": "LQ=="
+ },
+ "Children": [
+ {
+ "ID": "20260920131944-h75vath",
+ "Type": "NodeParagraph",
+ "Properties": {
+ "id": "20260920131944-h75vath",
+ "updated": "20260920131944"
+ },
+ "Children": [
+ {
+ "Type": "NodeText",
+ "Data": "Heading 6"
+ }
+ ]
+ }
+ ]
+ }
+ ]
+ }
+ ]
+ }
+ ]
+ }
+ ]
+ }
+ ]
+ }
+ ]
+ },
+ {
+ "ID": "20260920131944-zyq95qw",
+ "Type": "NodeListItem",
+ "Properties": {
+ "id": "20260920131944-zyq95qw",
+ "updated": "20260920131944"
+ },
+ "ListData": {
+ "Typ": 0,
+ "BulletChar": 45,
+ "Marker": "LQ=="
+ },
+ "Children": [
+ {
+ "ID": "20260920131944-d5ywuo5",
+ "Type": "NodeParagraph",
+ "Properties": {
+ "id": "20260920131944-d5ywuo5",
+ "updated": "20260920131944"
+ },
+ "Children": [
+ {
+ "Type": "NodeText",
+ "Data": "Picture"
+ }
+ ]
+ }
+ ]
+ },
+ {
+ "ID": "20260920131944-w2vou8e",
+ "Type": "NodeListItem",
+ "Properties": {
+ "id": "20260920131944-w2vou8e",
+ "updated": "20260920131944"
+ },
+ "ListData": {
+ "Typ": 0,
+ "BulletChar": 45,
+ "Marker": "LQ=="
+ },
+ "Children": [
+ {
+ "ID": "20260920131944-81fv6kk",
+ "Type": "NodeParagraph",
+ "Properties": {
+ "id": "20260920131944-81fv6kk",
+ "updated": "20260920131944"
+ },
+ "Children": [
+ {
+ "Type": "NodeText",
+ "Data": "Code block"
+ }
+ ]
+ },
+ {
+ "ID": "20260920131944-i0kv322",
+ "Type": "NodeList",
+ "Properties": {
+ "id": "20260920131944-i0kv322",
+ "updated": "20260920131944"
+ },
+ "ListData": {
+ "Typ": 0,
+ "Tight": true,
+ "BulletChar": 45,
+ "Marker": "LQ=="
+ },
+ "Children": [
+ {
+ "ID": "20260920131944-87428op",
+ "Type": "NodeListItem",
+ "Properties": {
+ "id": "20260920131944-87428op",
+ "updated": "20260920131944"
+ },
+ "ListData": {
+ "Typ": 0,
+ "BulletChar": 45,
+ "Marker": "LQ=="
+ },
+ "Children": [
+ {
+ "ID": "20260920131944-amp1011",
+ "Type": "NodeParagraph",
+ "Properties": {
+ "id": "20260920131944-amp1011",
+ "updated": "20260920131944"
+ },
+ "Children": [
+ {
+ "Type": "NodeText",
+ "Data": "Normal"
+ }
+ ]
+ }
+ ]
+ },
+ {
+ "ID": "20260920131944-pnwvlsz",
+ "Type": "NodeListItem",
+ "Properties": {
+ "id": "20260920131944-pnwvlsz",
+ "updated": "20260920131944"
+ },
+ "ListData": {
+ "Typ": 0,
+ "BulletChar": 45,
+ "Marker": "LQ=="
+ },
+ "Children": [
+ {
+ "ID": "20260920131944-60dw3sc",
+ "Type": "NodeParagraph",
+ "Properties": {
+ "id": "20260920131944-60dw3sc",
+ "updated": "20260920131944"
+ },
+ "Children": [
+ {
+ "Type": "NodeText",
+ "Data": "Syntax highlighting support"
+ }
+ ]
+ },
+ {
+ "ID": "20260920131944-27sp95n",
+ "Type": "NodeList",
+ "Properties": {
+ "id": "20260920131944-27sp95n",
+ "updated": "20260920131944"
+ },
+ "ListData": {
+ "Typ": 0,
+ "Tight": true,
+ "BulletChar": 45,
+ "Marker": "LQ=="
+ },
+ "Children": [
+ {
+ "ID": "20260920131944-trno8o3",
+ "Type": "NodeListItem",
+ "Properties": {
+ "id": "20260920131944-trno8o3",
+ "updated": "20260920131944"
+ },
+ "ListData": {
+ "Typ": 0,
+ "BulletChar": 45,
+ "Marker": "LQ=="
+ },
+ "Children": [
+ {
+ "ID": "20260920131944-3x3xns7",
+ "Type": "NodeParagraph",
+ "Properties": {
+ "id": "20260920131944-3x3xns7",
+ "updated": "20260920131944"
+ },
+ "Children": [
+ {
+ "Type": "NodeText",
+ "Data": "Demonstrate Go code highlighting"
+ }
+ ]
+ }
+ ]
+ },
+ {
+ "ID": "20260920131944-gkne8ce",
+ "Type": "NodeListItem",
+ "Properties": {
+ "id": "20260920131944-gkne8ce",
+ "updated": "20260920131944"
+ },
+ "ListData": {
+ "Typ": 0,
+ "BulletChar": 45,
+ "Marker": "LQ=="
+ },
+ "Children": [
+ {
+ "ID": "20260920131944-x9j86ie",
+ "Type": "NodeParagraph",
+ "Properties": {
+ "id": "20260920131944-x9j86ie",
+ "updated": "20260920131944"
+ },
+ "Children": [
+ {
+ "Type": "NodeText",
+ "Data": "Demo Java highlighting"
+ }
+ ]
+ }
+ ]
+ }
+ ]
+ }
+ ]
+ }
+ ]
+ }
+ ]
+ },
+ {
+ "ID": "20260920131944-qr3jo02",
+ "Type": "NodeListItem",
+ "Properties": {
+ "id": "20260920131944-qr3jo02",
+ "updated": "20260920131944"
+ },
+ "ListData": {
+ "Typ": 0,
+ "BulletChar": 45,
+ "Marker": "LQ=="
+ },
+ "Children": [
+ {
+ "ID": "20260920131944-dmlzypf",
+ "Type": "NodeParagraph",
+ "Properties": {
+ "id": "20260920131944-dmlzypf",
+ "updated": "20260920131944"
+ },
+ "Children": [
+ {
+ "Type": "NodeText",
+ "Data": "Ordered, disordered, task list"
+ }
+ ]
+ },
+ {
+ "ID": "20260920131944-ssi9lhg",
+ "Type": "NodeList",
+ "Properties": {
+ "id": "20260920131944-ssi9lhg",
+ "updated": "20260920131944"
+ },
+ "ListData": {
+ "Typ": 0,
+ "Tight": true,
+ "BulletChar": 45,
+ "Marker": "LQ=="
+ },
+ "Children": [
+ {
+ "ID": "20260920131944-zdigrkk",
+ "Type": "NodeListItem",
+ "Properties": {
+ "id": "20260920131944-zdigrkk",
+ "updated": "20260920131944"
+ },
+ "ListData": {
+ "Typ": 0,
+ "BulletChar": 45,
+ "Marker": "LQ=="
+ },
+ "Children": [
+ {
+ "ID": "20260920131944-kpuu2cy",
+ "Type": "NodeParagraph",
+ "Properties": {
+ "id": "20260920131944-kpuu2cy",
+ "updated": "20260920131944"
+ },
+ "Children": [
+ {
+ "Type": "NodeText",
+ "Data": "Unordered list"
+ }
+ ]
+ }
+ ]
+ },
+ {
+ "ID": "20260920131944-z6trqgt",
+ "Type": "NodeListItem",
+ "Properties": {
+ "id": "20260920131944-z6trqgt",
+ "updated": "20260920131944"
+ },
+ "ListData": {
+ "Typ": 0,
+ "BulletChar": 45,
+ "Marker": "LQ=="
+ },
+ "Children": [
+ {
+ "ID": "20260920131944-kcbcjgp",
+ "Type": "NodeParagraph",
+ "Properties": {
+ "id": "20260920131944-kcbcjgp",
+ "updated": "20260920131944"
+ },
+ "Children": [
+ {
+ "Type": "NodeText",
+ "Data": "Ordered list"
+ }
+ ]
+ }
+ ]
+ },
+ {
+ "ID": "20260920131944-9r2zkhb",
+ "Type": "NodeListItem",
+ "Properties": {
+ "id": "20260920131944-9r2zkhb",
+ "updated": "20260920131944"
+ },
+ "ListData": {
+ "Typ": 0,
+ "BulletChar": 45,
+ "Marker": "LQ=="
+ },
+ "Children": [
+ {
+ "ID": "20260920131944-awp1igd",
+ "Type": "NodeParagraph",
+ "Properties": {
+ "id": "20260920131944-awp1igd",
+ "updated": "20260920131944"
+ },
+ "Children": [
+ {
+ "Type": "NodeText",
+ "Data": "task list"
+ }
+ ]
+ }
+ ]
+ }
+ ]
+ }
+ ]
+ },
+ {
+ "ID": "20260920131944-wsm0xtj",
+ "Type": "NodeListItem",
+ "Properties": {
+ "id": "20260920131944-wsm0xtj",
+ "updated": "20260920131944"
+ },
+ "ListData": {
+ "Typ": 0,
+ "BulletChar": 45,
+ "Marker": "LQ=="
+ },
+ "Children": [
+ {
+ "ID": "20260920131944-a0y5ri0",
+ "Type": "NodeParagraph",
+ "Properties": {
+ "id": "20260920131944-a0y5ri0",
+ "updated": "20260920131944"
+ },
+ "Children": [
+ {
+ "Type": "NodeText",
+ "Data": "Form"
+ }
+ ]
+ }
+ ]
+ },
+ {
+ "ID": "20260920131944-vagbu7q",
+ "Type": "NodeListItem",
+ "Properties": {
+ "id": "20260920131944-vagbu7q",
+ "updated": "20260920131944"
+ },
+ "ListData": {
+ "Typ": 0,
+ "BulletChar": 45,
+ "Marker": "LQ=="
+ },
+ "Children": [
+ {
+ "ID": "20260920131944-sxwdd1k",
+ "Type": "NodeParagraph",
+ "Properties": {
+ "id": "20260920131944-sxwdd1k",
+ "updated": "20260920131944"
+ },
+ "Children": [
+ {
+ "Type": "NodeText",
+ "Data": "Hide details"
+ }
+ ]
+ }
+ ]
+ },
+ {
+ "ID": "20260920131944-jttg9rl",
+ "Type": "NodeListItem",
+ "Properties": {
+ "id": "20260920131944-jttg9rl",
+ "updated": "20260920131944"
+ },
+ "ListData": {
+ "Typ": 0,
+ "BulletChar": 45,
+ "Marker": "LQ=="
+ },
+ "Children": [
+ {
+ "ID": "20260920131944-sbm8zuh",
+ "Type": "NodeParagraph",
+ "Properties": {
+ "id": "20260920131944-sbm8zuh",
+ "updated": "20260920131944"
+ },
+ "Children": [
+ {
+ "Type": "NodeText",
+ "Data": "Paragraph"
+ }
+ ]
+ }
+ ]
+ },
+ {
+ "ID": "20260920131944-bf6bdo8",
+ "Type": "NodeListItem",
+ "Properties": {
+ "id": "20260920131944-bf6bdo8",
+ "updated": "20260920131944"
+ },
+ "ListData": {
+ "Typ": 0,
+ "BulletChar": 45,
+ "Marker": "LQ=="
+ },
+ "Children": [
+ {
+ "ID": "20260920131944-42k3k8t",
+ "Type": "NodeParagraph",
+ "Properties": {
+ "id": "20260920131944-42k3k8t",
+ "updated": "20260920131944"
+ },
+ "Children": [
+ {
+ "Type": "NodeText",
+ "Data": "Link reference"
+ }
+ ]
+ }
+ ]
+ },
+ {
+ "ID": "20260920131944-kxf2ljj",
+ "Type": "NodeListItem",
+ "Properties": {
+ "id": "20260920131944-kxf2ljj",
+ "updated": "20260920131944"
+ },
+ "ListData": {
+ "Typ": 0,
+ "BulletChar": 45,
+ "Marker": "LQ=="
+ },
+ "Children": [
+ {
+ "ID": "20260920131944-bt2y3mo",
+ "Type": "NodeParagraph",
+ "Properties": {
+ "id": "20260920131944-bt2y3mo",
+ "updated": "20260920131944"
+ },
+ "Children": [
+ {
+ "Type": "NodeText",
+ "Data": "Mathematical formula"
+ }
+ ]
+ }
+ ]
+ },
+ {
+ "ID": "20260920131944-xsqawxu",
+ "Type": "NodeListItem",
+ "Properties": {
+ "id": "20260920131944-xsqawxu",
+ "updated": "20260920131944"
+ },
+ "ListData": {
+ "Typ": 0,
+ "BulletChar": 45,
+ "Marker": "LQ=="
+ },
+ "Children": [
+ {
+ "ID": "20260920131944-z3axxv2",
+ "Type": "NodeParagraph",
+ "Properties": {
+ "id": "20260920131944-z3axxv2",
+ "updated": "20260920131944"
+ },
+ "Children": [
+ {
+ "Type": "NodeText",
+ "Data": "Mind Map"
+ }
+ ]
+ }
+ ]
+ },
+ {
+ "ID": "20260920131944-cgykgo9",
+ "Type": "NodeListItem",
+ "Properties": {
+ "id": "20260920131944-cgykgo9",
+ "updated": "20260920131944"
+ },
+ "ListData": {
+ "Typ": 0,
+ "BulletChar": 45,
+ "Marker": "LQ=="
+ },
+ "Children": [
+ {
+ "ID": "20260920131944-29fhe24",
+ "Type": "NodeParagraph",
+ "Properties": {
+ "id": "20260920131944-29fhe24",
+ "updated": "20260920131944"
+ },
+ "Children": [
+ {
+ "Type": "NodeText",
+ "Data": "Flow chart"
+ }
+ ]
+ }
+ ]
+ },
+ {
+ "ID": "20260920131944-xcnae2c",
+ "Type": "NodeListItem",
+ "Properties": {
+ "id": "20260920131944-xcnae2c",
+ "updated": "20260920131944"
+ },
+ "ListData": {
+ "Typ": 0,
+ "BulletChar": 45,
+ "Marker": "LQ=="
+ },
+ "Children": [
+ {
+ "ID": "20260920131944-z6y3dcr",
+ "Type": "NodeParagraph",
+ "Properties": {
+ "id": "20260920131944-z6y3dcr",
+ "updated": "20260920131944"
+ },
+ "Children": [
+ {
+ "Type": "NodeText",
+ "Data": "Timing diagram"
+ }
+ ]
+ }
+ ]
+ },
+ {
+ "ID": "20260920131944-90uz9yk",
+ "Type": "NodeListItem",
+ "Properties": {
+ "id": "20260920131944-90uz9yk",
+ "updated": "20260920131944"
+ },
+ "ListData": {
+ "Typ": 0,
+ "BulletChar": 45,
+ "Marker": "LQ=="
+ },
+ "Children": [
+ {
+ "ID": "20260920131944-0vxva96",
+ "Type": "NodeParagraph",
+ "Properties": {
+ "id": "20260920131944-0vxva96",
+ "updated": "20260920131944"
+ },
+ "Children": [
+ {
+ "Type": "NodeText",
+ "Data": "Gantt chart"
+ }
+ ]
+ }
+ ]
+ },
+ {
+ "ID": "20260920131944-iojxjbo",
+ "Type": "NodeListItem",
+ "Properties": {
+ "id": "20260920131944-iojxjbo",
+ "updated": "20260920131944"
+ },
+ "ListData": {
+ "Typ": 0,
+ "BulletChar": 45,
+ "Marker": "LQ=="
+ },
+ "Children": [
+ {
+ "ID": "20260920131944-1slrx3s",
+ "Type": "NodeParagraph",
+ "Properties": {
+ "id": "20260920131944-1slrx3s",
+ "updated": "20260920131944"
+ },
+ "Children": [
+ {
+ "Type": "NodeText",
+ "Data": "Chart"
+ }
+ ]
+ }
+ ]
+ },
+ {
+ "ID": "20260920131944-llpzjlo",
+ "Type": "NodeListItem",
+ "Properties": {
+ "id": "20260920131944-llpzjlo",
+ "updated": "20260920131944"
+ },
+ "ListData": {
+ "Typ": 0,
+ "BulletChar": 45,
+ "Marker": "LQ=="
+ },
+ "Children": [
+ {
+ "ID": "20260920131944-v666ddx",
+ "Type": "NodeParagraph",
+ "Properties": {
+ "id": "20260920131944-v666ddx",
+ "updated": "20260920131944"
+ },
+ "Children": [
+ {
+ "Type": "NodeText",
+ "Data": "Staff"
+ }
+ ]
+ }
+ ]
+ },
+ {
+ "ID": "20260920131944-fsc4970",
+ "Type": "NodeListItem",
+ "Properties": {
+ "id": "20260920131944-fsc4970",
+ "updated": "20260920131944"
+ },
+ "ListData": {
+ "Typ": 0,
+ "BulletChar": 45,
+ "Marker": "LQ=="
+ },
+ "Children": [
+ {
+ "ID": "20260920131944-ba9r8fe",
+ "Type": "NodeParagraph",
+ "Properties": {
+ "id": "20260920131944-ba9r8fe",
+ "updated": "20260920131944"
+ },
+ "Children": [
+ {
+ "Type": "NodeText",
+ "Data": "Graphviz"
+ }
+ ]
+ }
+ ]
+ },
+ {
+ "ID": "20260920131944-pm0ry2p",
+ "Type": "NodeListItem",
+ "Properties": {
+ "id": "20260920131944-pm0ry2p",
+ "updated": "20260920131944"
+ },
+ "ListData": {
+ "Typ": 0,
+ "BulletChar": 45,
+ "Marker": "LQ=="
+ },
+ "Children": [
+ {
+ "ID": "20260920131944-5letf02",
+ "Type": "NodeParagraph",
+ "Properties": {
+ "id": "20260920131944-5letf02",
+ "updated": "20260920131944"
+ },
+ "Children": [
+ {
+ "Type": "NodeText",
+ "Data": "Multimedia"
+ }
+ ]
+ }
+ ]
+ },
+ {
+ "ID": "20260920131944-eugd55s",
+ "Type": "NodeListItem",
+ "Properties": {
+ "id": "20260920131944-eugd55s",
+ "updated": "20260920131944"
+ },
+ "ListData": {
+ "Typ": 0,
+ "BulletChar": 45,
+ "Marker": "LQ=="
+ },
+ "Children": [
+ {
+ "ID": "20260920131944-jo5bsue",
+ "Type": "NodeParagraph",
+ "Properties": {
+ "id": "20260920131944-jo5bsue",
+ "updated": "20260920131944"
+ },
+ "Children": [
+ {
+ "Type": "NodeText",
+ "Data": "Footnote"
+ }
+ ]
+ }
+ ]
+ },
+ {
+ "ID": "20260920131944-aulmuns",
+ "Type": "NodeListItem",
+ "Properties": {
+ "id": "20260920131944-aulmuns",
+ "updated": "20260920131944"
+ },
+ "ListData": {
+ "Typ": 0,
+ "BulletChar": 45,
+ "Marker": "LQ=="
+ },
+ "Children": [
+ {
+ "ID": "20260920131944-upi30ju",
+ "Type": "NodeParagraph",
+ "Properties": {
+ "id": "20260920131944-upi30ju",
+ "updated": "20260920131944"
+ },
+ "Children": [
+ {
+ "Type": "NodeText",
+ "Data": "Shortcuts"
+ }
+ ]
+ }
+ ]
+ }
+ ]
+ }
+ ]
+ }
+ ]
+ },
+ {
+ "ID": "20240530101000-qvuwb7d",
+ "Type": "NodeParagraph",
+ "Properties": {
+ "ID": "20240530101000-ibiw8ul",
+ "id": "20240530101000-qvuwb7d",
+ "updated": "20260920131944"
},
"Children": [
{
"Type": "NodeText",
- "Data": "マインドマップをレンダリングするには、Markdown のリスト構文を使用します。"
+ "Data": "スラッシュメニューからマインドマップを作成するか、リストブロックをマインドマップビューに切り替えます。編集可能なドキュメントを開くと、従来のマインドマップがリストのマインドマップに自動変換され、ブロック ID と内容が保持されます。変換は元に戻す操作とドキュメント履歴からの復元に対応しています。完全に変換できない内容はソースのまま保持して表示します。読み取り専用ビューとエクスポートでは、元のドキュメントを変更せずに表示だけを変換します。"
}
]
},
diff --git a/app/src/assets/scss/component/_typography.scss b/app/src/assets/scss/component/_typography.scss
index 518b362dd0..4ded7a0b24 100644
--- a/app/src/assets/scss/component/_typography.scss
+++ b/app/src/assets/scss/component/_typography.scss
@@ -541,8 +541,7 @@
position: relative;
}
- [data-subtype="echarts"],
- [data-subtype="mindmap"] {
+ [data-subtype="echarts"] {
z-index: 1;
height: 420px;
diff --git a/app/src/assets/scss/protyle/_list-mindmap.scss b/app/src/assets/scss/protyle/_list-mindmap.scss
index 07acf68f01..b81532056f 100644
--- a/app/src/assets/scss/protyle/_list-mindmap.scss
+++ b/app/src/assets/scss/protyle/_list-mindmap.scss
@@ -3,6 +3,11 @@
.protyle-wysiwyg,
.b3-typography {
+ [data-subtype="mindmap"],
+ [data-type="NodeList"][data-list-mindmap-rendered="true"] {
+ height: auto !important;
+ }
+
[data-type="NodeList"][data-list-mindmap-rendered="true"] > [data-type="NodeListItem"] {
display: none;
}
@@ -26,6 +31,16 @@
line-height: 1.5;
outline: none;
+ &--source {
+ height: auto;
+ min-height: 0;
+
+ pre {
+ white-space: pre-wrap;
+ overflow-wrap: anywhere;
+ }
+ }
+
[hidden] {
display: none !important;
}
diff --git a/app/src/config/entryVisibility/catalog.ts b/app/src/config/entryVisibility/catalog.ts
index c72f009193..8a185c2745 100644
--- a/app/src/config/entryVisibility/catalog.ts
+++ b/app/src/config/entryVisibility/catalog.ts
@@ -570,7 +570,7 @@ const slashMenuBuiltinChildren = [
node("flowChart", literal("FlowChart")),
node("graph", literal("Graphviz")),
node("mermaid", literal("Mermaid")),
- node("mindmap", literal("Mind map")),
+ node("mindmap", lang("mindmap")),
node("UML", literal("PlantUML")),
separator("separator_5"),
node("infoStyle", lang("infoStyle")),
diff --git a/app/src/mobile/util/keyboardToolbar.ts b/app/src/mobile/util/keyboardToolbar.ts
index b95fdca842..5707e3bdba 100644
--- a/app/src/mobile/util/keyboardToolbar.ts
+++ b/app/src/mobile/util/keyboardToolbar.ts
@@ -784,7 +784,7 @@ const renderSlashMenu = (protyle: IProtyle, toolbarElement: Element) => {
${getSlashItem("```flowchart\n```", "", "Flow Chart", "true")}
${getSlashItem("```graphviz\n```", "", "Graph", "true")}
${getSlashItem("```mermaid\n```", "", "Mermaid", "true")}
- ${getSlashItem("```mindmap\n```", "", window.siyuan.languages.mindmap, "true")}
+ ${getSlashItem(`- ${Lute.Caret}\n{: ${Constants.CUSTOM_SY_LIST_MINDMAP}="1"}`, "iconMindmap", window.siyuan.languages.mindmap, "true")}
${getSlashItem("```plantuml\n```", "", "UML", "true")}
</div>
<div class="keyboard__slash-title"></div>
diff --git a/app/src/plugin/customBlockRender.ts b/app/src/plugin/customBlockRender.ts
index 42f9b3f8ad..c1bcce44f8 100644
--- a/app/src/plugin/customBlockRender.ts
+++ b/app/src/plugin/customBlockRender.ts
@@ -120,14 +120,14 @@ const collectCustomBlocks = (element: Element) => {
const renderCustomBlock = (element: HTMLElement, force = false) => {
const rootElement = element.closest<HTMLElement>(".protyle-wysiwyg");
- const context = rootElement && rootContexts.get(rootElement);
+ const context = !element.closest(".list-mindmap__preview-block") && rootElement && rootContexts.get(rootElement);
const info = element.getAttribute("data-info") || "";
const content = element.getAttribute("data-content") || "";
const decoded = decodeCustomBlockInfo(info);
const plugin = decoded && activePlugins.has(decoded.pluginName)
? window.siyuan.ws?.app?.plugins.find(item => item.name === decoded.pluginName)
: undefined;
- const render = decoded ? plugin?.customBlockRenders[decoded.blockType]?.render : undefined;
+ const render = context && decoded ? plugin?.customBlockRenders[decoded.blockType]?.render : undefined;
const state = renderStates.get(element);
if (!force && state?.info === info && state.content === content && state.render === render &&
state.root === rootElement) {
@@ -150,7 +150,7 @@ const renderCustomBlock = (element: HTMLElement, force = false) => {
let contentUpdateQueued = false;
let rendering = true;
const isCurrentRoot = () => element.closest<HTMLElement>(".protyle-wysiwyg") === rootElement &&
- rootContexts.get(rootElement) === context;
+ rootContexts.get(rootElement) === context && !element.closest(".list-mindmap__preview-block");
const setContent = (newContent: string) => {
if (typeof newContent !== "string" || !isCustomBlockContentValid(newContent) || rendering ||
!context.ready || context.disabled() || !element.isConnected || !isCurrentRoot() ||
diff --git a/app/src/protyle/export/listMindmapExport.test.ts b/app/src/protyle/export/listMindmapExport.test.ts
index c4d40d326d..b521c1a624 100644
--- a/app/src/protyle/export/listMindmapExport.test.ts
+++ b/app/src/protyle/export/listMindmapExport.test.ts
@@ -52,7 +52,7 @@ test("the public mind map renderer also renders documents containing only list m
const dependencies: Record<string, unknown> = {
"../../constants": {Constants: {PROTYLE_CDN: "stage/protyle"}},
"./listMindmap/render": {listMindmapRender: () => calls.push("list")},
- "../util/addScript": {addScript: () => calls.push("echarts")},
+ "./listMindmap/legacy": {renderLegacyMindmaps: () => calls.push("legacy")},
};
runInNewContext(compiled, {
exports: exported,
@@ -63,5 +63,5 @@ test("the public mind map renderer also renders documents containing only list m
getAttribute: (): string | null => null,
querySelectorAll: (): Element[] => [],
});
- assert.deepEqual(calls, ["list"]);
+ assert.deepEqual(calls, ["list", "legacy"]);
});
diff --git a/app/src/protyle/gutter/index.ts b/app/src/protyle/gutter/index.ts
index 7373a9f5b3..dea9875c74 100644
--- a/app/src/protyle/gutter/index.ts
+++ b/app/src/protyle/gutter/index.ts
@@ -2334,7 +2334,7 @@ export class Gutter {
}
}] : [])]
}).element);
- } else if (type === "NodeCodeBlock" && !protyle.disabled && ["echarts", "mindmap"].includes(nodeElement.getAttribute("data-subtype"))) {
+ } else if (type === "NodeCodeBlock" && !protyle.disabled && nodeElement.getAttribute("data-subtype") === "echarts") {
window.siyuan.menus.menu.append(new MenuItem({id: "separator_chart", type: "separator"}).element);
const height = (nodeElement as HTMLElement).style.height;
let html = nodeElement.outerHTML;
diff --git a/app/src/protyle/hint/extend.ts b/app/src/protyle/hint/extend.ts
index d37e48a49e..cb7030f94a 100644
--- a/app/src/protyle/hint/extend.ts
+++ b/app/src/protyle/hint/extend.ts
@@ -392,8 +392,8 @@ export const getBuiltinSlashMenuItems = (protyle: IProtyle): IHintData[] => {
}, {
filter: [window.siyuan.languages.mindmap, "mindmap", "脑图", "naotu", "nt"],
id: "mindmap",
- value: "```mindmap\n```",
- html: `<div class="b3-list-item__first"><span class="b3-list-item__text">Mind map</span><span class="b3-list-item__meta">${window.siyuan.languages.mindmap}</span></div>`,
+ value: `- ${Lute.Caret}\n{: ${Constants.CUSTOM_SY_LIST_MINDMAP}="1"}`,
+ html: `<div class="b3-list-item__first"><svg class="b3-list-item__graphic"><use xlink:href="#iconMindmap"></use></svg><span class="b3-list-item__text">${window.siyuan.languages.mindmap}</span></div>`,
}, {
filter: ["plantuml", "建模语言", "jianmoyuyan", "jmyy"],
id: "UML",
diff --git a/app/src/protyle/hint/index.ts b/app/src/protyle/hint/index.ts
index 7143043e58..8341b6333c 100644
--- a/app/src/protyle/hint/index.ts
+++ b/app/src/protyle/hint/index.ts
@@ -33,6 +33,7 @@ import {getContenteditableElement, hasNextSibling, hasPreviousSibling} from "../
import {transaction, updateTransaction} from "../wysiwyg/transaction";
import {insertHTML} from "../util/insertHTML";
import {highlightRender} from "../render/highlightRender";
+import {spinListMindmapDOM} from "../render/listMindmap/create";
import {assetMenu, imgMenu} from "../../menus/protyle";
import {hideElements} from "../ui/hideElements";
import {fetchPost} from "../../util/fetch";
@@ -1052,7 +1053,8 @@ ${genHintItemHTML(item)}
if (value !== "![]()") {
this.fixImageCursor(range);
}
- let textContent = value;
+ const isMindmap = value === `- ${Lute.Caret}\n{: ${Constants.CUSTOM_SY_LIST_MINDMAP}="1"}`;
+ let textContent = isMindmap ? `- ${Lute.Caret}` : value;
if (value === "```") {
textContent = value + (Constants.SIYUAN_RENDER_CODE_LANGUAGES.includes(window.siyuan.storage[Constants.LOCAL_CODELANG]) ? "" : window.siyuan.storage[Constants.LOCAL_CODELANG]) + Lute.Caret + "\n```";
}
@@ -1091,7 +1093,8 @@ ${genHintItemHTML(item)}
newHTML = `<div data-node-id="${id}" data-type="NodeHTMLBlock" class="render-node" data-subtype="block">${genIconHTML()}<div><protyle-html data-content=""></protyle-html><span style="position: absolute">${Constants.ZWSP}</span></div><div class="protyle-attr" contenteditable="false"></div></div>`;
} else {
editableElement.textContent = textContent;
- newHTML = protyle.lute.SpinBlockDOM(nodeElement.outerHTML);
+ newHTML = isMindmap ? spinListMindmapDOM(protyle.lute, nodeElement.outerHTML) :
+ protyle.lute.SpinBlockDOM(nodeElement.outerHTML);
}
// 列表项内创建列表时保留空段落,避免形成 li>list 非法结构 https://github.com/siyuan-note/siyuan/issues/17890
const tempCheck = document.createElement("div");
@@ -1137,7 +1140,8 @@ ${genHintItemHTML(item)}
}]);
}
} else {
- let newHTML = protyle.lute.SpinBlockDOM(textContent);
+ let newHTML = isMindmap ? spinListMindmapDOM(protyle.lute, textContent) :
+ protyle.lute.SpinBlockDOM(textContent);
if (value === "<div>") {
newHTML = `<div data-node-id="${Lute.NewNodeID()}" data-type="NodeHTMLBlock" class="render-node" data-subtype="block">${genIconHTML()}<div><protyle-html data-content=""></protyle-html><span style="position: absolute">${Constants.ZWSP}</span></div><div class="protyle-attr" contenteditable="false"></div></div>`;
}
diff --git a/app/src/protyle/render/av/render.ts b/app/src/protyle/render/av/render.ts
index 7afc364e8d..882d0e2fd1 100644
--- a/app/src/protyle/render/av/render.ts
+++ b/app/src/protyle/render/av/render.ts
@@ -567,6 +567,9 @@ export const avRender = async (element: Element, protyle: IProtyle, cb?: (data:
}
for (let i = 0; i < avElements.length; i++) {
const e = avElements[i] as HTMLElement;
+ if (e.closest(".list-mindmap__preview-block")) {
+ continue;
+ }
e.removeAttribute("data-rendering");
if (e.getAttribute("data-render") === "true" || hasClosestByClassName(e, "av__gallery-content")) {
continue;
@@ -775,7 +778,8 @@ const refreshTimeouts: {
} = {};
const getAVElements = (protyle: IProtyle, avID: string, viewID?: string): HTMLElement[] => {
- const elements = Array.from(protyle.wysiwyg.element.querySelectorAll(`.av[data-av-id="${avID}"]`)) as HTMLElement[];
+ const elements = Array.from(protyle.wysiwyg.element.querySelectorAll<HTMLElement>(`.av[data-av-id="${avID}"]`))
+ .filter(item => !item.closest(".list-mindmap__preview-block"));
if (viewID) {
return elements.filter((item) => getViewIDByAVElement(item) === viewID);
}
diff --git a/app/src/protyle/render/blockRender.ts b/app/src/protyle/render/blockRender.ts
index 644ac287d2..c9b73ad677 100644
--- a/app/src/protyle/render/blockRender.ts
+++ b/app/src/protyle/render/blockRender.ts
@@ -27,6 +27,9 @@ export const blockRender = (protyle: IProtyle, element: Element, top?: number, o
return;
}
blockElements.forEach((item: HTMLElement) => {
+ if (item.closest(".list-mindmap__preview-block")) {
+ return;
+ }
const content = Lute.UnEscapeHTMLStr(item.getAttribute("data-content"));
if (!content.trim()) {
genRenderFrame(item);
diff --git a/app/src/protyle/render/chartRender.ts b/app/src/protyle/render/chartRender.ts
index d621d27d63..0d80535003 100644
--- a/app/src/protyle/render/chartRender.ts
+++ b/app/src/protyle/render/chartRender.ts
@@ -68,7 +68,7 @@ export const chartRender = (element: Element, cdn = Constants.PROTYLE_CDN) => {
width = wysiswgElement.firstElementChild.clientWidth;
}
echartsElements.forEach(async (e: HTMLDivElement) => {
- if (e.closest('[data-protyle-lite-render="safe"]')) {
+ if (e.closest('[data-protyle-lite-render="safe"], .list-mindmap__preview-block')) {
return;
}
e.setAttribute("data-render", "true");
@@ -117,7 +117,7 @@ export const refreshChartTheme = (element: Element) => {
}
const refreshElements: HTMLElement[] = [];
echartsElements.forEach((item) => {
- if (item.closest('[data-protyle-lite-render="safe"]')) {
+ if (item.closest('[data-protyle-lite-render="safe"], .list-mindmap__preview-block')) {
return;
}
const chartElement = item.querySelector<HTMLElement>("[_echarts_instance_]");
diff --git a/app/src/protyle/render/htmlRender.ts b/app/src/protyle/render/htmlRender.ts
index 7e005bdad8..d28285acf6 100644
--- a/app/src/protyle/render/htmlRender.ts
+++ b/app/src/protyle/render/htmlRender.ts
@@ -9,6 +9,9 @@ export const htmlRender = (element: Element) => {
return;
}
htmlElements.forEach((e) => {
+ if (e.closest(".list-mindmap__preview-block")) {
+ return;
+ }
e.setAttribute("data-render", "true");
e.firstElementChild.firstElementChild.setAttribute("aria-label", window.siyuan.languages.edit);
e.firstElementChild.lastElementChild.setAttribute("aria-label", window.siyuan.languages.more);
diff --git a/app/src/protyle/render/listMindmap/create.ts b/app/src/protyle/render/listMindmap/create.ts
new file mode 100644
index 0000000000..a2cbd33afe
--- /dev/null
+++ b/app/src/protyle/render/listMindmap/create.ts
@@ -0,0 +1,29 @@
+import {Constants} from "../../../constants";
+
+// 隐藏列表正文前交接选区,后续按键交由脑图处理。
+export const focusListMindmap = (list: HTMLElement, host: HTMLElement): Range | undefined => {
+ const selection = window.getSelection();
+ const active = document.activeElement;
+ if (!selection?.anchorNode || !list.contains(selection.anchorNode) || host.contains(selection.anchorNode) ||
+ (active !== document.body && !list.contains(active) && active !== list.closest(".protyle-wysiwyg"))) {
+ return;
+ }
+ host.focus({preventScroll: true});
+ const range = document.createRange();
+ range.selectNodeContents(host);
+ range.collapse(true);
+ selection.removeAllRanges();
+ selection.addRange(range);
+ return range;
+};
+
+// 先按普通列表转换,再设置视图属性,保持空段落转换时的块 ID。
+export const spinListMindmapDOM = (lute: Lute, html: string) => {
+ const template = document.createElement("template");
+ template.innerHTML = lute.SpinBlockDOM(html);
+ const list = template.content.firstElementChild;
+ if (list?.getAttribute("data-type") === "NodeList") {
+ list.setAttribute(Constants.CUSTOM_SY_LIST_MINDMAP, "1");
+ }
+ return template.innerHTML;
+};
diff --git a/app/src/protyle/render/listMindmap/index.ts b/app/src/protyle/render/listMindmap/index.ts
index c1868b2f09..7e26c04b7e 100644
--- a/app/src/protyle/render/listMindmap/index.ts
+++ b/app/src/protyle/render/listMindmap/index.ts
@@ -6,6 +6,8 @@ import {updateTransaction, transaction} from "../../wysiwyg/transaction";
import {genListItemElement, setTaskListItemMarker} from "../../wysiwyg/list";
import {nextTaskListMarker, nextTaskListStatus} from "../../wysiwyg/taskListMarker";
import {getTaskStatusItems} from "../../wysiwyg/taskStatusDialog";
+import {getTabTask} from "../tabsRender";
+import {focusBlock} from "../../util/selection";
import {Menu} from "../../../plugin/Menu";
import {completeTabsListSource} from "../../wysiwyg/tabsList";
import {waitForPendingTransactions} from "../../util/transactionQueue";
@@ -24,16 +26,18 @@ import {openInlineStyleDialog} from "../../toolbar/inlineStyleDialog";
import {
addListMindmapNode, cleanListMindmapHTML, deleteListMindmapNode,
moveListMindmapNode, readListMindmap, replaceListMindmapContent,
- writeListMindmapMetadata,
+ writeListMindmapMetadata, getListMindmapTabItem,
} from "./model";
import type {ListMindmapMetadata, ListMindmapModel} from "./model";
import {getListMindmapElements, registerListMindmapRoot} from "./render";
import {ListMindmapView} from "./view";
import {openListMindmapEditor} from "./editor";
+import {focusListMindmap} from "./create";
const roots = new WeakMap<IProtyle, {refresh: () => void, destroy: () => void}>();
const canToggleView = (owner: IProtyle, list: HTMLElement) => !owner.disabled && !owner.lite &&
+ list.isConnected && !!list.dataset.nodeId &&
!owner.options.action.includes(Constants.CB_GET_HISTORY) &&
list.closest(".protyle-wysiwyg") === owner.wysiwyg.element;
@@ -179,6 +183,18 @@ class ListMindmapController {
},
onEdit: (id, contentHost) => this.edit(id, contentHost),
onTaskToggle: (id, cycle) => this.setTask(id, cycle ? nextTaskListStatus : nextTaskListMarker),
+ onTabTaskToggle: (id, itemId) => this.setTabTask(id, itemId, nextTaskListMarker),
+ onTabTaskMenu: (id, itemId, anchor) => {
+ const item = getListMindmapTabItem(list, id, itemId);
+ const marker = item && getTabTask(item);
+ if (!canEdit(owner, list) || marker == null) {
+ return;
+ }
+ const menu = new Menu();
+ getTaskStatusItems(marker, next => this.setTabTask(id, itemId, () => next)).forEach(entry => menu.addItem(entry));
+ const rect = anchor.getBoundingClientRect();
+ menu.open({x: rect.left, y: rect.bottom, h: rect.height});
+ },
onTaskMenu: (id, anchor) => {
if (!canEdit(owner, list)) {
return;
@@ -254,6 +270,12 @@ class ListMindmapController {
});
list.dataset.listMindmapRendered = "true";
this.snapshot = cleanListMindmapHTML(list.outerHTML);
+ if (canEdit(owner, list)) {
+ const range = focusListMindmap(list, this.host);
+ if (range) {
+ owner.toolbar.range = range;
+ }
+ }
}
private metadata(change: (metadata: ListMindmapMetadata) => void | false) {
@@ -267,15 +289,7 @@ class ListMindmapController {
}
private setTask(id: string, next: (marker: string) => string) {
- // 连续操作串行提交,正文保存后重新查找源节点,避免使用过期状态覆盖任务。
- this.taskChanges = this.taskChanges.then(async () => {
- if (this.disposed || !this.list.isConnected || !canEdit(this.owner, this.list) ||
- (this.activeEditor && !await this.activeEditor.finish())) {
- return;
- }
- if (this.disposed || !this.list.isConnected || !canEdit(this.owner, this.list)) {
- return;
- }
+ return this.queueTask(() => {
const node = readListMindmap(this.list).nodes.get(id);
if (node?.taskMarker === undefined) {
return;
@@ -285,6 +299,37 @@ class ListMindmapController {
setTaskListItemMarker(this.owner, node.element, marker);
this.refresh();
}
+ });
+ }
+
+ private setTabTask(id: string, itemId: string, next: (marker: string) => string) {
+ return this.queueTask(async () => {
+ await this.change(() => {
+ const item = getListMindmapTabItem(this.list, id, itemId);
+ const marker = item && getTabTask(item);
+ if (marker == null) {
+ return false;
+ }
+ const value = next(marker);
+ if (value === marker) {
+ return false;
+ }
+ item.setAttribute("tabs-task", value);
+ }, true);
+ });
+ }
+
+ private queueTask(change: () => void | Promise<void>) {
+ // 连续操作串行提交,正文保存后重新查找源节点,避免使用过期状态覆盖任务。
+ this.taskChanges = this.taskChanges.then(async () => {
+ if (this.disposed || !this.list.isConnected || !canEdit(this.owner, this.list) ||
+ (this.activeEditor && !await this.activeEditor.finish())) {
+ return;
+ }
+ if (this.disposed || !this.list.isConnected || !canEdit(this.owner, this.list)) {
+ return;
+ }
+ await change();
}).catch(error => {
console.error(error);
showMessage(window.siyuan.languages.listMindmapInvalid);
@@ -375,15 +420,21 @@ class ListMindmapController {
return;
}
this.disposed = true;
+ const restoreFocus = this.host.contains(document.activeElement) && this.list.isConnected &&
+ this.list.getAttribute(Constants.CUSTOM_SY_LIST_MINDMAP) !== "1";
this.activeEditor?.destroy();
this.view.destroy();
this.host.remove();
this.list.removeAttribute("data-list-mindmap-rendered");
+ if (restoreFocus) {
+ focusBlock(this.list);
+ }
}
}
// 补齐折叠隐藏的正文后才允许改动列表,避免以局部视图覆盖完整块树。
const completeList = async (owner: IProtyle, list: HTMLElement) => {
+ await owner.wysiwyg.flushPendingInput();
await waitForPendingTransactions(owner);
if (!list.isConnected) {
return "failed";
diff --git a/app/src/protyle/render/listMindmap/legacy.ts b/app/src/protyle/render/listMindmap/legacy.ts
new file mode 100644
index 0000000000..a895bf3091
--- /dev/null
+++ b/app/src/protyle/render/listMindmap/legacy.ts
@@ -0,0 +1,134 @@
+import {Constants} from "../../../constants";
+import {readListMindmap} from "./model";
+import {ListMindmapView} from "./view";
+
+const previews = new WeakMap<HTMLElement, {source: string, view?: ListMindmapView}>();
+const mountedPreviews = new Map<HTMLElement, {view: ListMindmapView, connected: boolean}>();
+let removalObserver: MutationObserver;
+let parser: Lute;
+
+const trackPreview = (block: HTMLElement, view: ListMindmapView) => {
+ mountedPreviews.set(block, {view, connected: block.isConnected});
+ if (removalObserver) {
+ return;
+ }
+ // 预览随文档或历史窗口关闭时释放全局事件,避免隐藏视图继续响应键盘和打印。
+ removalObserver = new MutationObserver(() => {
+ mountedPreviews.forEach((preview, element) => {
+ if (element.isConnected) {
+ preview.connected = true;
+ } else if (preview.connected) {
+ preview.view.destroy();
+ mountedPreviews.delete(element);
+ previews.delete(element);
+ element.removeAttribute("data-render");
+ }
+ });
+ if (mountedPreviews.size === 0) {
+ removalObserver.disconnect();
+ removalObserver = undefined;
+ }
+ });
+ removalObserver.observe(block.ownerDocument.documentElement, {childList: true, subtree: true});
+};
+
+export const parseLegacyMindmap = (source: string, lute: Lute): HTMLElement | undefined => {
+ if (!source.trim()) {
+ return;
+ }
+ const template = document.createElement("template");
+ template.innerHTML = lute.Md2BlockDOM(source);
+ const blocks = Array.from(template.content.children);
+ if (blocks.length !== 1 || blocks[0].getAttribute("data-type") !== "NodeList") {
+ return;
+ }
+ const list = blocks[0] as HTMLElement;
+ if (list.hasAttribute(Constants.CUSTOM_SY_LIST_MINDMAP_DATA)) {
+ return;
+ }
+ list.setAttribute(Constants.CUSTOM_SY_LIST_MINDMAP, "1");
+ return list;
+};
+
+const getParser = () => {
+ if (!parser) {
+ parser = Lute.New();
+ parser.SetTextMark(true);
+ parser.SetKramdownIAL(true);
+ parser.SetProtyleWYSIWYG(true);
+ parser.SetBlockRef(true);
+ parser.SetFileAnnotationRef(true);
+ parser.SetHTMLTag2TextMark(true);
+ parser.SetHeadingID(false);
+ parser.SetYamlFrontMatter(false);
+ parser.SetToC(false);
+ parser.SetSetext(false);
+ parser.SetFootnotes(false);
+ parser.SetLinkRef(false);
+ parser.SetIndentCodeBlock(false);
+ parser.SetGFMStrikethrough1(false);
+ parser.SetArbitraryTaskListItemMarker(true);
+ parser.SetEnsureListItemParagraph(true);
+ parser.SetDataTask(true);
+ parser.SetExportNormalizeTaskListMarker(false);
+ }
+ return parser;
+};
+
+// 旧数据仅作为迁移输入;预览保留代码块身份和原文,派生节点不参与编辑、复制和保存。
+export const renderLegacyMindmaps = (root: Element, cdn?: string) => {
+ const selector = '[data-subtype="mindmap"]:not([data-render="true"])';
+ const blocks = Array.from(root.querySelectorAll<HTMLElement>(selector));
+ if (root.getAttribute("data-subtype") === "mindmap" && root.getAttribute("data-render") !== "true") {
+ blocks.unshift(root as HTMLElement);
+ }
+ blocks.forEach(block => {
+ if (block.closest(".list-mindmap")) {
+ return;
+ }
+ const source = Lute.UnEscapeHTMLStr(block.getAttribute("data-content") || "");
+ const previous = previews.get(block);
+ if (previous?.source === source) {
+ previous.view?.refreshLayout();
+ block.dataset.render = "true";
+ return;
+ }
+ previous?.view?.destroy();
+ mountedPreviews.delete(block);
+ block.querySelectorAll(":scope > .list-mindmap").forEach(item => item.remove());
+ const host = document.createElement("div");
+ host.className = "list-mindmap";
+ host.contentEditable = "false";
+ block.appendChild(host);
+ const showSource = (invalid: boolean) => {
+ host.classList.add("list-mindmap--source");
+ const message = document.createElement("div");
+ message.className = "ft__secondary";
+ message.textContent = invalid ? window.siyuan?.languages?.listMindmapMigrationInvalid || "" : "";
+ const code = document.createElement("pre");
+ code.textContent = source;
+ host.replaceChildren(message, code);
+ previews.set(block, {source});
+ };
+ try {
+ const list = parseLegacyMindmap(source, getParser());
+ if (!list) {
+ throw new Error("Mind map source must contain one complete list");
+ }
+ const view = new ListMindmapView({
+ host, model: readListMindmap(list), readOnly: true, cdn,
+ labels: window.siyuan?.languages || {}, printLayout: !!block.closest("[data-export-pdf]"),
+ onExit: () => {
+ view.destroy();
+ mountedPreviews.delete(block);
+ showSource(false);
+ },
+ });
+ previews.set(block, {source, view});
+ trackPreview(block, view);
+ } catch {
+ showSource(true);
+ }
+ block.dataset.render = "true";
+ });
+};
diff --git a/app/src/protyle/render/listMindmap/migrate.test.ts b/app/src/protyle/render/listMindmap/migrate.test.ts
new file mode 100644
index 0000000000..c091c7ef5d
--- /dev/null
+++ b/app/src/protyle/render/listMindmap/migrate.test.ts
@@ -0,0 +1,100 @@
+import * as assert from "node:assert/strict";
+import {readFileSync} from "node:fs";
+import test from "node:test";
+import {runInNewContext} from "node:vm";
+import {createSourceFile, isVariableStatement, ModuleKind, ScriptTarget, transpileModule} from "typescript";
+
+const source = createSourceFile("migrate.ts", readFileSync("src/protyle/render/listMindmap/migrate.ts", "utf8"), ScriptTarget.Latest, true);
+const code = source.statements.filter(isVariableStatement).filter(statement =>
+ !statement.declarationList.declarations.some(item => item.name.getText(source) === "replaceLegacyMindmapHTML"))
+ .map(statement => statement.getText(source)).join("\n");
+
+const setup = () => {
+ const calls: unknown[] = [];
+ const completions: ((response: unknown) => void)[] = [];
+ const Constants = {
+ CUSTOM_SY_READONLY: "custom-sy-readonly", CB_GET_HISTORY: "history", CB_GET_BACKLINK: "backlink",
+ CB_GET_APPEND: "append", CB_GET_BEFORE: "before",
+ };
+ const exports: {
+ migrateLegacyMindmapsBeforeRender?: (...args: unknown[]) => boolean;
+ cancelLegacyMindmapMigration?: (protyle: unknown) => void;
+ } = {};
+ const window = {siyuan: {config: {readonly: false, editor: {readOnly: false}}}};
+ runInNewContext(transpileModule(code, {compilerOptions: {module: ModuleKind.CommonJS, target: ScriptTarget.ES2021}}).outputText, {
+ exports, Constants, window, console,
+ replaceLegacyMindmapHTML: (html: string) => html,
+ waitForPendingTransactions: async (): Promise<void> => undefined,
+ fetchSyncPost: (...args: unknown[]) => {
+ calls.push(args);
+ return new Promise(resolve => completions.push(resolve));
+ },
+ });
+ const protyle = {
+ block: {rootID: "doc"}, notebookId: "box", options: {}, disabled: false,
+ wysiwyg: {element: {getAttribute: (): string | null => null}, flushPendingInput: (): void => undefined},
+ };
+ return {run: exports.migrateLegacyMindmapsBeforeRender, cancel: exports.cancelLegacyMindmapMigration,
+ protyle, calls, completions, window};
+};
+
+const tick = () => new Promise(resolve => setImmediate(resolve));
+
+test("closing the editor cancels rendering while a migration request is pending", async () => {
+ const {run, cancel, protyle, completions} = setup();
+ run(protyle, "source", [], () => assert.fail("closed editor rendered"));
+ await tick();
+ cancel(protyle);
+ completions[0]({code: 0, data: {blocks: []}});
+ await tick();
+});
+
+test("opening a document migrates once and resumes only the newest pending render", async () => {
+ const {run, protyle, calls, completions} = setup();
+ const rendered: string[] = [];
+ assert.equal(run(protyle, "old render", [], (html: string) => rendered.push(html)), true);
+ assert.equal(run(protyle, "latest render", [], (html: string) => rendered.push(html)), true);
+ await tick();
+ assert.equal(calls.length, 1);
+ completions[0]({code: 0, data: {blocks: []}});
+ await tick();
+ assert.deepEqual(rendered, ["latest render"]);
+ assert.equal(run(protyle, "undo", [], () => assert.fail("undo retriggered migration")), false);
+ assert.equal(calls.length, 1);
+});
+
+test("read-only, history, backlink, paging and local editors never request migration", async () => {
+ for (const mode of ["readonly", "editorReadonly", "disabled", "lite", "history", "backlink", "append", "before", "preview"]) {
+ const {run, protyle, calls, window} = setup();
+ const actions: string[] = [];
+ if (mode === "readonly") {
+ window.siyuan.config.readonly = true;
+ } else if (mode === "editorReadonly") {
+ window.siyuan.config.editor.readOnly = true;
+ } else if (["disabled", "lite"].includes(mode)) {
+ Object.assign(protyle, {[mode]: true});
+ } else if (mode === "preview") {
+ Object.assign(protyle.options, {mode: "preview"});
+ } else {
+ actions.push(mode);
+ }
+ assert.equal(run(protyle, "source", actions, () => assert.fail(mode)), false, mode);
+ await tick();
+ assert.equal(calls.length, 0, mode);
+ }
+});
+
+test("migration failure still opens source and a stale document response cannot replace the current document", async () => {
+ const {run, protyle, completions} = setup();
+ const rendered: string[] = [];
+ run(protyle, "first", [], (html: string) => rendered.push(html));
+ await tick();
+ protyle.block.rootID = "second";
+ run(protyle, "second", [], (html: string) => rendered.push(html));
+ await tick();
+ completions[0]({code: 0, data: {blocks: []}});
+ completions[1]({code: -1});
+ await tick();
+ assert.deepEqual(rendered, ["second"]);
+ assert.equal(run(protyle, "source", [], () => assert.fail("retry")), false);
+});
diff --git a/app/src/protyle/render/listMindmap/migrate.ts b/app/src/protyle/render/listMindmap/migrate.ts
new file mode 100644
index 0000000000..74a7fa3088
--- /dev/null
+++ b/app/src/protyle/render/listMindmap/migrate.ts
@@ -0,0 +1,78 @@
+import {Constants} from "../../../constants";
+import {fetchSyncPost} from "../../../util/fetch";
+import {waitForPendingTransactions} from "../../util/transactionQueue";
+
+interface Migration {
+ rootID: string;
+ pending: boolean;
+ resume: (blocks: {id: string, dom: string}[]) => void;
+}
+
+const migrations = new WeakMap<IProtyle, Migration>();
+
+export const cancelLegacyMindmapMigration = (protyle: IProtyle) => {
+ migrations.delete(protyle);
+};
+
+export const replaceLegacyMindmapHTML = (html: string, blocks: {id: string, dom: string}[]) => {
+ const template = document.createElement("template");
+ template.innerHTML = html;
+ const replacements = new Map(blocks.map(block => [block.id, block.dom]));
+ template.content.querySelectorAll<HTMLElement>('[data-type="NodeCodeBlock"][data-subtype="mindmap"]')
+ .forEach(block => {
+ if (block.closest('[data-type="NodeBlockQueryEmbed"]')) {
+ return;
+ }
+ const replacement = replacements.get(block.dataset.nodeId);
+ if (replacement) {
+ block.outerHTML = replacement;
+ }
+ });
+ return template.innerHTML;
+};
+
+// 每个编辑器的当前文档只迁移一次,撤销和分页加载不会再次触发;只读内容仅使用派生预览。
+export const migrateLegacyMindmapsBeforeRender = (protyle: IProtyle, html: string, actions: string[],
+ resume: (html: string) => void) => {
+ const rootID = protyle.block.rootID;
+ if (!rootID || protyle.lite || protyle.disabled || protyle.options.backlinkData || protyle.options.history ||
+ protyle.options.mode === "preview" || window.siyuan.config.readonly || window.siyuan.config.editor.readOnly ||
+ protyle.wysiwyg.element.getAttribute(Constants.CUSTOM_SY_READONLY) === "true" ||
+ actions.some(action => [Constants.CB_GET_HISTORY, Constants.CB_GET_BACKLINK,
+ Constants.CB_GET_APPEND, Constants.CB_GET_BEFORE].includes(action))) {
+ return false;
+ }
+ const previous = migrations.get(protyle);
+ const callback = (blocks: {id: string, dom: string}[]) => resume(replaceLegacyMindmapHTML(html, blocks));
+ if (previous?.rootID === rootID) {
+ if (previous.pending) {
+ previous.resume = callback;
+ }
+ return previous.pending;
+ }
+ const migration: Migration = {rootID, pending: true, resume: callback};
+ migrations.set(protyle, migration);
+ const run = async () => {
+ let blocks: {id: string, dom: string}[] = [];
+ try {
+ protyle.wysiwyg.flushPendingInput();
+ await waitForPendingTransactions(protyle);
+ if (protyle.block.rootID !== rootID || migrations.get(protyle) !== migration) {
+ return;
+ }
+ const response = await fetchSyncPost("/api/block/migrateLegacyMindmaps", {id: rootID, notebook: protyle.notebookId});
+ if (response.code === 0) {
+ blocks = response.data.blocks;
+ }
+ } catch (error) {
+ console.error(error);
+ } finally {
+ migration.pending = false;
+ if (protyle.block.rootID === rootID && migrations.get(protyle) === migration) {
+ migration.resume(blocks);
+ }
+ }
+ };
+ void run();
+ return true;
+};
diff --git a/app/src/protyle/render/listMindmap/model.test.ts b/app/src/protyle/render/listMindmap/model.test.ts
index a4076590a6..417d65c1aa 100644
--- a/app/src/protyle/render/listMindmap/model.test.ts
+++ b/app/src/protyle/render/listMindmap/model.test.ts
@@ -125,7 +125,9 @@ test("layout rejects cyclic or invalid trees and supports deep nesting without r
const browserCases = async (sourceCode: string, css: string, taskSource: string, taskCSS: string) => {
const check = require("node:assert/strict");
const api = new Function("mathRender", "Constants", sourceCode + "; return {readListMindmap, moveListMindmapNode, addListMindmapNode, " +
- "deleteListMindmapNode, replaceListMindmapContent, cleanListMindmapHTML, remapListMindmapIDs, writeListMindmapMetadata, ListMindmapView};")(
+ "deleteListMindmapNode, replaceListMindmapContent, cleanListMindmapHTML, remapListMindmapIDs, writeListMindmapMetadata, " +
+ "parseLegacyMindmap, renderLegacyMindmaps, replaceLegacyMindmapHTML, spinListMindmapDOM, focusListMindmap, " +
+ "tabsRender, destroyTabsRender, getTabTask, getListMindmapTabItem, ListMindmapView};")(
async (element: Element) => {
const formulas = element.querySelectorAll('[data-subtype="math"]:not([data-render="true"])');
await Promise.resolve();
@@ -146,6 +148,102 @@ const browserCases = async (sourceCode: string, css: string, taskSource: string,
const ids = (list: HTMLElement) => Array.from(list.querySelectorAll("[data-node-id]")).map(element =>
element.getAttribute("data-node-id"));
+ // 旧格式预览只生成派生视图,复制和保存仍保留完整代码原文。
+ const legacySource = "- **Root**\n - [X] Done\n - [/] Progress\n";
+ const legacyBlock = reset("```mindmap\n" + legacySource + "```\n");
+ const legacyContent = legacyBlock.getAttribute("data-content");
+ const legacyID = legacyBlock.dataset.nodeId;
+ document.body.append(holder);
+ api.renderLegacyMindmaps(holder);
+ check.ok(legacyBlock.querySelector(".list-mindmap__node"));
+ check.equal(legacyBlock.getAttribute("data-content"), legacyContent);
+ check.equal(legacyBlock.dataset.nodeId, legacyID);
+ check.equal(legacyBlock.dataset.type, "NodeCodeBlock");
+ check.ok(!legacyBlock.querySelector(".list-mindmap__route-handle"));
+ const legacySaved = api.cleanListMindmapHTML(legacyBlock.outerHTML);
+ check.ok(!legacySaved.includes("list-mindmap__node"));
+ check.ok(lute.BlockDOM2StdMd(legacySaved).includes(legacySource.trim()));
+ const legacyHost = legacyBlock.querySelector(".list-mindmap");
+ legacyBlock.removeAttribute("data-render");
+ api.renderLegacyMindmaps(legacyBlock);
+ check.equal(legacyBlock.querySelector(".list-mindmap"), legacyHost);
+ holder.remove();
+ await new Promise(resolve => setTimeout(resolve, 0));
+ check.equal(legacyBlock.hasAttribute("data-render"), false);
+ document.body.append(holder);
+ api.renderLegacyMindmaps(holder);
+ check.ok(legacyBlock.querySelector(".list-mindmap__node"));
+ const multiRoot = api.parseLegacyMindmap("- First\n- Second\n", lute);
+ check.equal(api.readListMindmap(multiRoot).metadata.rootTitle, undefined);
+ for (const invalidSource of ["", "Plain text", "- List\n\nOutside text", "- First\n\n1. Second"]) {
+ check.equal(api.parseLegacyMindmap(invalidSource, lute), undefined);
+ }
+ const invalidBlock = reset("```mindmap\n- List\n\nOutside text\n```\n");
+ api.renderLegacyMindmaps(invalidBlock);
+ check.equal(invalidBlock.querySelector("pre").textContent, Lute.UnEscapeHTMLStr(invalidBlock.getAttribute("data-content")));
+ check.equal(invalidBlock.dataset.type, "NodeCodeBlock");
+ const newMindmap = reset(`- ${Lute.Caret}\n{: custom-sy-list-mindmap="1"}`);
+ check.equal(newMindmap.dataset.type, "NodeList");
+ check.equal(newMindmap.getAttribute("custom-sy-list-mindmap"), "1");
+ const creationSource = `- ${Lute.Caret}`;
+ const paragraph = reset("Empty\n");
+ const paragraphID = paragraph.dataset.nodeId;
+ paragraph.querySelector('[contenteditable="true"]').textContent = creationSource;
+ for (const input of [creationSource, paragraph.outerHTML]) {
+ holder.innerHTML = api.spinListMindmapDOM(lute, input);
+ check.equal(holder.childElementCount, 1);
+ check.equal(holder.firstElementChild.getAttribute("data-type"), "NodeList");
+ check.equal(holder.firstElementChild.getAttribute("custom-sy-list-mindmap"), "1");
+ if (input === paragraph.outerHTML) {
+ check.equal(holder.firstElementChild.getAttribute("data-node-id"), paragraphID);
+ }
+ const createdModel = api.readListMindmap(holder.firstElementChild);
+ check.equal(createdModel.nodes.size, 1);
+ const saved = lute.SpinBlockDOM(holder.innerHTML);
+ holder.innerHTML = saved;
+ check.equal(holder.childElementCount, 1);
+ check.equal(holder.firstElementChild.getAttribute("custom-sy-list-mindmap"), "1");
+ }
+ const focusRoot = document.createElement("div");
+ focusRoot.className = "protyle-wysiwyg";
+ focusRoot.contentEditable = "true";
+ focusRoot.innerHTML = api.spinListMindmapDOM(lute, creationSource);
+ document.body.append(focusRoot);
+ const focusList = focusRoot.firstElementChild as HTMLElement;
+ const focusHost = document.createElement("div");
+ focusList.append(focusHost);
+ let mindmapKeys = 0;
+ let documentKeys = 0;
+ focusRoot.addEventListener("keydown", () => documentKeys++);
+ const focusView = new api.ListMindmapView({host: focusHost, model: api.readListMindmap(focusList),
+ onExit: () => {}, onAdd: () => mindmapKeys++});
+ const sourceRange = document.createRange();
+ sourceRange.selectNodeContents(focusList.querySelector('[contenteditable="true"]'));
+ sourceRange.collapse(true);
+ focusRoot.focus();
+ window.getSelection().removeAllRanges();
+ window.getSelection().addRange(sourceRange);
+ check.ok(api.focusListMindmap(focusList, focusHost));
+ check.equal(document.activeElement, focusHost);
+ check.ok(focusHost.contains(window.getSelection().anchorNode));
+ focusHost.dispatchEvent(new KeyboardEvent("keydown", {key: "Enter", bubbles: true, cancelable: true}));
+ check.equal(mindmapKeys, 1);
+ check.equal(documentKeys, 0, "new mindmap keys never reach the hidden source list");
+ const elsewhere = document.createElement("input");
+ document.body.append(elsewhere);
+ elsewhere.focus();
+ check.equal(api.focusListMindmap(focusList, focusHost), undefined);
+ check.equal(document.activeElement, elsewhere, "mounting does not steal focus from another input");
+ focusView.destroy();
+ focusRoot.remove();
+ elsewhere.remove();
+ const canonical = [{id: legacyID, dom: newMindmap.outerHTML}];
+ const embedded = `<div data-type="NodeBlockQueryEmbed">${legacySaved}</div>`;
+ holder.innerHTML = api.replaceLegacyMindmapHTML(legacySaved + embedded, canonical);
+ check.equal(holder.firstElementChild.getAttribute("data-type"), "NodeList");
+ check.ok(holder.querySelector('[data-type="NodeBlockQueryEmbed"] [data-subtype="mindmap"]'));
+ holder.remove();
+
// 直属子列表形成分支,其他正文中的嵌套列表属于正文,读取不会重建或移动任何原始块。
let list = reset("* Parent\n\n Second paragraph\n\n * Child\n * Grandchild\n\n* Sibling\n");
let model = api.readListMindmap(list);
@@ -260,6 +358,21 @@ const browserCases = async (sourceCode: string, css: string, taskSource: string,
check.equal(edited.contentBlocks[2].dataset.nodeId, added.dataset.nodeId);
check.equal(editable.element.querySelector(':scope > [data-type="NodeList"]'), childList);
check.equal(childList.outerHTML, childHTML);
+ const nestedTaskHolder = document.createElement("div");
+ lute.SetDataTask(true);
+ nestedTaskHolder.innerHTML = lute.Md2BlockDOM("- Node\n\n > - [ ] Nested task\n");
+ const nestedTaskList = nestedTaskHolder.firstElementChild as HTMLElement;
+ const nestedTaskModel = api.readListMindmap(nestedTaskList);
+ const nestedContent: HTMLElement[] = nestedTaskModel.root.contentBlocks.map((block: HTMLElement) => block.cloneNode(true) as HTMLElement);
+ const nestedTask = nestedContent.find((block: HTMLElement) => block.dataset.type === "NodeBlockquote")
+ .querySelector<HTMLElement>('.li[data-subtype="t"]');
+ nestedTask.setAttribute("data-task", "X");
+ nestedTask.classList.add("protyle-task--done");
+ nestedTask.querySelector(".protyle-action--task").setAttribute("data-task", "X");
+ check.equal(api.replaceListMindmapContent(nestedTaskList, nestedTaskModel.root.id,
+ nestedContent.map((block: HTMLElement) => block.outerHTML).join("")), true);
+ check.equal(nestedTaskList.querySelector('.li[data-subtype="t"]').getAttribute("data-task"), "X",
+ "saving rich content retains its edited nested task marker");
check.equal(list.querySelector("wbr"), null);
const beforeRejectedEdit = list.outerHTML;
check.equal(api.replaceListMindmapContent(list, editable.id, childHTML), false);
@@ -1321,6 +1434,7 @@ const browserCases = async (sourceCode: string, css: string, taskSource: string,
const singleList = reset("* Single\n");
const single = new api.ListMindmapView({...options, model: api.readListMindmap(singleList)});
await settle();
+ check.equal(single.scale, 1, "initial layout keeps a single node at its normal size");
single.fit();
check.ok(single.scale > 1 && single.scale <= 2.5, "fit enlarges small maps within the zoom limit");
const fitViewport = host.querySelector<HTMLElement>(".list-mindmap__viewport").getBoundingClientRect();
@@ -1335,6 +1449,22 @@ const browserCases = async (sourceCode: string, css: string, taskSource: string,
check.ok(host.querySelector<HTMLElement>(".list-mindmap__node").getBoundingClientRect().bottom <=
fitInspector.getBoundingClientRect().top, "fit keeps content above the visible inspector");
fitInspector.hidden = true;
+ lute.SetTabs(true);
+ const tabsContainer = document.createElement("div");
+ tabsContainer.innerHTML = lute.Md2BlockDOM("::: tabs\n@tab First\n\nOne\n@tab Second\n\nTwo\n:::\n");
+ const sourceTabs = tabsContainer.firstElementChild as HTMLElement;
+ const sourceItems = sourceTabs.querySelectorAll<HTMLElement>(":scope > .tab-item");
+ sourceTabs.setAttribute("tabs-active-id", sourceItems[1].dataset.nodeId);
+ const sourceTabsHTML = sourceTabs.outerHTML;
+ const tabsModel = api.readListMindmap(singleList);
+ tabsModel.root.contentBlocks = [sourceTabs];
+ single.update(tabsModel);
+ const previewTabs = host.querySelector<HTMLElement>(".tabs");
+ const previewItems = previewTabs.querySelectorAll<HTMLElement>(":scope > .tab-item");
+ check.ok(previewItems[0].id && previewItems[1].id && previewItems[0].id !== previewItems[1].id);
+ check.equal(previewTabs.getAttribute("tabs-active-id"), previewItems[1].id);
+ check.equal(previewTabs.querySelector("[data-node-id]"), null);
+ check.equal(sourceTabs.outerHTML, sourceTabsHTML);
const emptyModel = api.readListMindmap(singleList);
const emptyBlock = document.createElement("div");
emptyBlock.innerHTML = "<div><br></div>";
@@ -1490,6 +1620,70 @@ const browserCases = async (sourceCode: string, css: string, taskSource: string,
check.equal(exportClick, true, "export anchor clicks reach the existing navigation handler");
exportView.destroy();
+ // 复杂块保留在源列表中;预览不携带块身份,媒体控件也不触发节点拖拽或编辑。
+ const specialList = reset("- Root\n - First\n - Second\n");
+ const specialRoot = specialList.querySelector<HTMLElement>(".li");
+ const specials = document.createElement("div");
+ ["NodeTable", "NodeAttributeView", "NodeBlockQueryEmbed", "NodeCustomBlock", "NodeHTMLBlock", "NodeCallout",
+ "NodeSuperBlock", "NodeVideo", "NodeAudio", "NodeIFrame", "NodeWidget"].forEach(type => {
+ const element = document.createElement("div");
+ element.dataset.nodeId = Lute.NewNodeID();
+ element.dataset.type = type;
+ element.dataset.content = "Source content";
+ element.setAttribute("custom-preserved", "value");
+ if (type === "NodeTable") {
+ element.innerHTML = '<table><tbody><tr><td>Cell</td></tr></tbody></table><div class="protyle-action__table"></div>';
+ } else {
+ element.textContent = type;
+ }
+ const tag = ({NodeVideo: "video", NodeAudio: "audio", NodeIFrame: "iframe"} as Record<string, string>)[type];
+ if (tag) {
+ const media = document.createElement(tag);
+ media.setAttribute("controls", "");
+ element.append(media);
+ }
+ specials.append(element);
+ });
+ specialRoot.querySelector(".p").after(...Array.from(specials.children));
+ const sourceChart = document.createElement("div");
+ sourceChart.dataset.type = "NodeCodeBlock";
+ sourceChart.dataset.nodeId = Lute.NewNodeID();
+ sourceChart.setAttribute("_echarts_instance_", "source-instance");
+ const sourceCanvas = document.createElement("canvas");
+ sourceCanvas.width = 4;
+ sourceCanvas.height = 4;
+ sourceCanvas.getContext("2d").fillStyle = "#123456";
+ sourceCanvas.getContext("2d").fillRect(0, 0, 4, 4);
+ sourceChart.append(sourceCanvas);
+ specialRoot.querySelector(".p").after(sourceChart);
+ const sourceContent = api.readListMindmap(specialList).root.contentBlocks.map((block: HTMLElement) => block.outerHTML);
+ let specialEdits = 0;
+ const specialView = new api.ListMindmapView({host: richHost, model: api.readListMindmap(specialList),
+ onExit: () => {}, onEdit: () => specialEdits++, onMove: () => check.fail("Media started a node move")});
+ check.equal(richHost.querySelector("[data-node-id]"), null);
+ check.equal(richHost.querySelector(".protyle-action__table"), null);
+ check.equal(richHost.querySelector("[_echarts_instance_]"), null);
+ check.deepEqual(Array.from(richHost.querySelector<HTMLCanvasElement>(".list-mindmap__content canvas")
+ .getContext("2d").getImageData(0, 0, 1, 1).data), [18, 52, 86, 255]);
+ for (const tag of ["audio", "video", "iframe"]) {
+ const media = richHost.querySelector(tag);
+ const pointer = new PointerEvent("pointerdown", {bubbles: true, cancelable: true, pointerId: 9, button: 0});
+ media.dispatchEvent(pointer);
+ check.equal(pointer.defaultPrevented, false, tag);
+ check.equal(specialView.pointer, undefined, tag);
+ const keyboard = new KeyboardEvent("keydown", {key: " ", bubbles: true, cancelable: true});
+ media.dispatchEvent(keyboard);
+ check.equal(keyboard.defaultPrevented, false, tag);
+ media.dispatchEvent(new MouseEvent("dblclick", {bubbles: true, cancelable: true}));
+ check.equal(specialEdits, 0, tag);
+ }
+ const specialChildren = api.readListMindmap(specialList).root.children;
+ check.equal(api.moveListMindmapNode(specialList, specialChildren[1].id, specialChildren[0].id, "before"), true);
+ specialView.update(api.readListMindmap(specialList));
+ check.deepEqual(api.readListMindmap(specialList).root.contentBlocks.map((block: HTMLElement) => block.outerHTML), sourceContent);
+ specialView.destroy();
+ check.deepEqual(api.readListMindmap(specialList).root.contentBlocks.map((block: HTMLElement) => block.outerHTML), sourceContent);
+
// 真实列表与脑图逐项比较图标、删除线和颜色,覆盖导出及脱离编辑器容器的全屏布局。
const taskStyle = document.createElement("style");
taskStyle.textContent = taskCSS;
@@ -1512,12 +1706,14 @@ const browserCases = async (sourceCode: string, css: string, taskSource: string,
taskParent.append(taskHost);
const operations: {id: string, before: string, after: string}[] = [];
const taskAPI = new Function("readListMindmap", "canEdit", "Constants", "dayjs", "updateTransaction", "showMessage",
+ "getListMindmapTabItem", "getTabTask", "cleanListMindmapHTML",
taskSource + "; return {setTaskListItemMarker, nextTaskListMarker, nextTaskListStatus, TaskController};")(
api.readListMindmap, (owner: any) => !owner.disabled && !owner.history && !owner.embedded,
{CB_GET_HISTORY: "history", ATTRIBUTE_EDITING: "data-editing"},
() => ({format: () => "20260920000000"}),
(_owner: unknown, element: HTMLElement, before: string) => operations.push({id: element.dataset.nodeId,
- before, after: element.outerHTML}), () => check.fail("Task update failed"));
+ before, after: api.cleanListMindmapHTML(element.outerHTML)}), () => check.fail("Task update failed"),
+ api.getListMindmapTabItem, api.getTabTask, api.cleanListMindmapHTML);
const owner = {disabled: false, history: false, embedded: false, options: {action: [] as string[]}};
let finishTask: boolean | Promise<boolean> = true;
let menus = 0;
@@ -1642,6 +1838,88 @@ const browserCases = async (sourceCode: string, css: string, taskSource: string,
taskView.update(rootModel);
check.ok(taskButton());
taskView.destroy();
+ // 页签预览将任务操作交给所属脑图保存,外层页签渲染器不能接管派生控件。
+ taskParent.innerHTML = lute.Md2BlockDOM("- Container\n");
+ const tabList = taskParent.firstElementChild as HTMLElement;
+ const tabNode = tabList.querySelector<HTMLElement>(".li");
+ const tabNodeID = tabNode.dataset.nodeId;
+ const tabContent = document.createElement("div");
+ tabContent.innerHTML = lute.Md2BlockDOM("::: tabs\n@tab First\n\nOne\n@tab Second\n\nTwo\n:::\n{: tabs-task=\"true\"}\n");
+ tabNode.querySelector(".p").replaceWith(tabContent.firstElementChild);
+ const tabSource = tabNode.querySelector<HTMLElement>(".tabs");
+ const sourceActiveTab = tabSource.getAttribute("tabs-active-id");
+ const tabItemIDs = Array.from(tabSource.querySelectorAll<HTMLElement>(":scope > .tab-item"))
+ .map(item => item.dataset.nodeId);
+ const tabHost = document.createElement("div");
+ tabList.append(tabHost);
+ const tabController = Object.assign(new taskAPI.TaskController(), {owner, list: tabList, disposed: false,
+ taskChanges: Promise.resolve(), refresh: () => tabView.update(api.readListMindmap(tabList))});
+ let tabMenus = 0;
+ const tabView = new api.ListMindmapView({host: tabHost, model: api.readListMindmap(tabList), onExit: () => {},
+ onTabTaskToggle: (id: string, itemID: string) => tabController.setTabTask(id, itemID, taskAPI.nextTaskListMarker),
+ onTabTaskMenu: (id: string, itemID: string, anchor: HTMLElement) => {
+ check.equal(id, tabNodeID);
+ check.equal(itemID, tabItemIDs[1]);
+ check.ok(anchor.classList.contains("tabs-task"));
+ tabMenus++;
+ }});
+ const outerOptions = {readonly: () => false, task: () => check.fail("Outer editor claimed a preview task")};
+ api.tabsRender(taskParent, outerOptions);
+ const previewTask = (index = 1) => tabHost.querySelectorAll<HTMLElement>(".tabs-task")[index];
+ const previewTab = (index = 1) => tabHost.querySelectorAll<HTMLElement>(".tabs-tab")[index];
+ previewTab().click();
+ operations.length = 0;
+ previewTask().click();
+ await tabController.taskChanges;
+ check.equal(operations.length, 1);
+ check.equal(operations[0].id, tabList.dataset.nodeId);
+ check.equal(api.getTabTask(api.getListMindmapTabItem(tabList, tabNodeID, tabItemIDs[1])), "X");
+ check.equal(previewTask().getAttribute("data-task"), "X");
+ check.equal(previewTab().getAttribute("aria-selected"), "true", "saving a task preserves the visible preview tab");
+ check.equal(tabHost.querySelector(".tabs-control"), null, "preview only exposes supported writes");
+ check.equal(tabHost.querySelector("[data-node-id]"), null);
+ check.equal(tabSource.getAttribute("tabs-active-id"), sourceActiveTab, "preview navigation does not change source navigation");
+ for (const [html, marker] of [[operations[0].after, "X"], [operations[0].before, " "]] as const) {
+ replay.innerHTML = lute.SpinBlockDOM(html);
+ check.equal(api.getTabTask(replay.querySelectorAll(".tab-item")[1]), marker);
+ check.ok(!html.includes("list-mindmap__"));
+ }
+ api.tabsRender(taskParent, outerOptions);
+ previewTask().dispatchEvent(new MouseEvent("contextmenu", {bubbles: true, cancelable: true}));
+ check.equal(tabMenus, 1);
+ previewTask().click();
+ previewTask().click();
+ await tabController.taskChanges;
+ check.equal(previewTask().getAttribute("data-task"), "X", "queued clicks read the latest source state");
+ previewTask().dispatchEvent(new KeyboardEvent("keydown", {key: " ", bubbles: true, cancelable: true}));
+ await tabController.taskChanges;
+ check.equal(previewTask().getAttribute("data-task"), " ");
+ const savedCount = operations.length;
+ tabView.setReadOnly(true);
+ check.equal(previewTask().getAttribute("aria-disabled"), "true");
+ previewTask().click();
+ await tabController.taskChanges;
+ check.equal(operations.length, savedCount);
+ previewTab(0).click();
+ check.equal(previewTab(0).getAttribute("aria-selected"), "true", "readonly previews still navigate");
+ tabView.setReadOnly(false);
+ for (const mode of ["disabled", "history", "embedded"] as const) {
+ owner[mode] = true;
+ await tabController.setTabTask(tabNodeID, tabItemIDs[1], () => "X");
+ check.equal(operations.length, savedCount);
+ owner[mode] = false;
+ }
+ tabController.activeEditor = {finish: async () => false};
+ previewTask().click();
+ await tabController.taskChanges;
+ check.equal(operations.length, savedCount, "failed content saves prevent tab task changes");
+ tabController.activeEditor = undefined;
+ const removedTab = api.getListMindmapTabItem(tabList, tabNodeID, tabItemIDs[1]);
+ removedTab.remove();
+ await tabController.setTabTask(tabNodeID, tabItemIDs[1], () => "X");
+ check.equal(operations.length, savedCount, "removed tab IDs never produce an update");
+ tabView.destroy();
+ api.destroyTabsRender(taskParent);
taskParent.remove();
taskStyle.remove();
hostParent.remove();
@@ -1660,8 +1938,14 @@ test("list mindmap mutations preserve block data in the real DOM and Lute", {
readFileSync(file, "utf8").replace(/^import [\s\S]*?;\r?\n/gm, "").replace(/^export /gm, ""), {
compilerOptions: {target: typescript.ScriptTarget.ES2021},
}).outputText;
- const source = compile(path.join(__dirname, "../av/richTextValue.ts")) + compile(path.join(__dirname, "../../wysiwyg/listContext.ts")) +
- compile(path.join(__dirname, "model.ts")) + compile(path.join(__dirname, "routing.ts")) + compile(path.join(__dirname, "view.ts"));
+ const tabsSource = "const {tabsRender, destroyTabsRender, getTabTask} = (() => {" +
+ ["../../../util/escape.ts", "../tabsState.ts", "../tabsDrag.ts", "../tabsAttributes.ts", "../tabsRender.ts"]
+ .map(file => compile(path.join(__dirname, file))).join("\n") +
+ "return {tabsRender, destroyTabsRender, getTabTask};})();\n";
+ const source = tabsSource + compile(path.join(__dirname, "../av/richTextValue.ts")) + compile(path.join(__dirname, "../../wysiwyg/listContext.ts")) +
+ compile(path.join(__dirname, "model.ts")) + compile(path.join(__dirname, "routing.ts")) + compile(path.join(__dirname, "view.ts")) +
+ compile(path.join(__dirname, "legacy.ts")) + compile(path.join(__dirname, "migrate.ts")) +
+ compile(path.join(__dirname, "create.ts"));
const css = require("sass").compile(path.resolve(__dirname, "../../../assets/scss/business/_block.scss")).css +
require("sass").compile(path.resolve(__dirname, "../../../assets/scss/business/_color.scss")).css +
require("sass").compile(path.resolve(__dirname, "../../../assets/scss/protyle/_list-mindmap.scss")).css;
@@ -1670,14 +1954,15 @@ test("list mindmap mutations preserve block data in the real DOM and Lute", {
const indexSource = typescript.createSourceFile("index.ts", readFileSync(path.join(__dirname, "index.ts"), "utf8"),
typescript.ScriptTarget.Latest, true);
const controller = indexSource.statements.find(typescript.isClassDeclaration);
- const setTask = controller.members.find(member => member.name?.getText(indexSource) === "setTask");
+ const taskMethods = controller.members.filter(member => ["setTask", "setTabTask", "queueTask", "change"]
+ .includes(member.name?.getText(indexSource)));
const listSource = typescript.createSourceFile("list.ts", readFileSync(path.join(__dirname, "../../wysiwyg/list.ts"), "utf8"),
typescript.ScriptTarget.Latest, true);
const setter = listSource.statements.filter(typescript.isVariableStatement).find(statement =>
statement.declarationList.declarations.some(item => item.name.getText(listSource) === "setTaskListItemMarker"));
const taskSource = compile(path.join(__dirname, "../../wysiwyg/taskListMarker.ts")) +
typescript.transpileModule(setter.getText(listSource).replace(/^export /, "") +
- `\nclass TaskController {${setTask.getText(indexSource)}}`, {
+ `\nclass TaskController {${taskMethods.map(member => member.getText(indexSource)).join("\n")}}`, {
compilerOptions: {target: typescript.ScriptTarget.ES2021},
}).outputText;
const lutePath = path.resolve(__dirname, "../../../../stage/protyle/js/lute/lute.min.js");
diff --git a/app/src/protyle/render/listMindmap/model.ts b/app/src/protyle/render/listMindmap/model.ts
index 5d4da33ab1..b20ecb8587 100644
--- a/app/src/protyle/render/listMindmap/model.ts
+++ b/app/src/protyle/render/listMindmap/model.ts
@@ -561,7 +561,9 @@ export const replaceListMindmapContent = (list: HTMLElement, nodeId: string, blo
const original = originals.get(id);
if (original) {
Array.from(original.attributes).forEach(attribute => {
- if (!["data-type", "data-subtype", "class", "updated", "contenteditable"].includes(attribute.name) &&
+ if (!block.hasAttribute(attribute.name) &&
+ !["data-type", "data-subtype", "class", "updated", "contenteditable", "data-task", "data-marker", "fold"]
+ .includes(attribute.name) &&
!attribute.name.startsWith("data-list-mindmap-")) {
block.setAttribute(attribute.name, attribute.value);
}
@@ -588,3 +590,10 @@ export const replaceListMindmapContent = (list: HTMLElement, nodeId: string, blo
});
return true;
};
+
+// 仅返回该节点正文中的源页签,预览副本和其他分支不参与保存。
+export const getListMindmapTabItem = (list: HTMLElement, nodeId: string, itemId: string): HTMLElement | undefined => {
+ const node = readListMindmap(list).nodes.get(nodeId);
+ return node?.contentBlocks.flatMap(block => Array.from(block.querySelectorAll<HTMLElement>('[data-type="NodeTabItem"]')))
+ .find(item => item.dataset.nodeId === itemId);
+};
diff --git a/app/src/protyle/render/listMindmap/preview.test.ts b/app/src/protyle/render/listMindmap/preview.test.ts
new file mode 100644
index 0000000000..8cb3e81830
--- /dev/null
+++ b/app/src/protyle/render/listMindmap/preview.test.ts
@@ -0,0 +1,230 @@
+import * as assert from "node:assert/strict";
+import {execFile} from "node:child_process";
+import {mkdtempSync, readFileSync, rmSync, writeFileSync} from "node:fs";
+import {tmpdir} from "node:os";
+import * as path from "node:path";
+import {promisify} from "node:util";
+import test from "node:test";
+import {createSourceFile, isClassDeclaration, isVariableStatement, ScriptTarget, transpileModule} from "typescript";
+
+const compile = (text: string) => transpileModule(text.replace(/^export /gm, ""), {
+ compilerOptions: {target: ScriptTarget.ES2021},
+}).outputText;
+
+const extract = (file: string, names: string[]) => {
+ const source = createSourceFile(file, readFileSync(path.join(__dirname, file), "utf8"), ScriptTarget.Latest, true);
+ const declarations = source.statements.filter(statement => isVariableStatement(statement) &&
+ statement.declarationList.declarations.some(declaration => names.includes(declaration.name.getText(source))));
+ assert.equal(declarations.length, names.length);
+ return compile(declarations.map(declaration => declaration.getText(source)).join("\n"));
+};
+
+const cases = async (source: string) => {
+ const check = require("node:assert/strict");
+ const requests: {url: string, data: Record<string, string>}[] = [];
+ const messages: string[] = [];
+ const chartRefreshes: Element[] = [];
+ const dependencies = {
+ fetchPost: (url: string, data: Record<string, string>) => requests.push({url, data}),
+ fetchSyncPost: () => check.fail("Preview requested database data"),
+ genRenderFrame: () => {},
+ isEncryptedBox: () => false,
+ hasClosestByClassName: (element: HTMLElement, name: string) => element.closest(`.${name}`),
+ showMessage: (message: string) => messages.push(message),
+ cleanListMindmapHTML: (html: string) => html,
+ chartRender: (element: Element) => chartRefreshes.push(element),
+ mountProtyleLiteFragment: () => check.fail("Unsupported content was passed to the editor sanitizer"),
+ };
+ const api = new Function(...Object.keys(dependencies), source + "; return {customBlockRender, " +
+ "registerCustomBlockRoot, setCustomBlockRootReady, unregisterCustomBlockRoot, activateCustomBlockPlugin, " +
+ "deactivateCustomBlockPlugin, htmlRender, blockRender, avRender, getAVElements, getCell, getTableNode, " +
+ "TablePreviewControl, refreshChartTheme, getAVRichTextUnsupportedPasteBlocks, openListMindmapEditor};")(...Object.values(dependencies));
+ const root = document.createElement("div");
+ root.className = "protyle-wysiwyg";
+ document.body.append(root);
+ const protyle = {wysiwyg: {element: root}, block: {rootID: "document"}};
+ const block = (type: string, html = "") => {
+ const element = document.createElement("div");
+ element.dataset.type = type;
+ element.dataset.nodeId = type;
+ element.innerHTML = html;
+ root.append(element);
+ return element;
+ };
+ const preview = (element: HTMLElement) => {
+ const clone = element.cloneNode(true) as HTMLElement;
+ clone.classList.add("list-mindmap__preview-block");
+ clone.removeAttribute("data-node-id");
+ root.append(clone);
+ return clone;
+ };
+ let sourceSetter: (content: string) => boolean;
+ let renders = 0;
+ const updates: string[] = [];
+ window.siyuan = {
+ languages: new Proxy({}, {get: (_target, key) => String(key)}),
+ config: {editor: {embedBlockBreadcrumb: false, headingEmbedMode: 0}},
+ ws: {app: {plugins: [{name: "preview-test", customBlockRenders: {test: {
+ render: (options: {element: HTMLElement, setContent: (content: string) => boolean}) => {
+ renders++;
+ sourceSetter = options.setContent;
+ options.element.innerHTML = "<button>Plugin control</button>";
+ },
+ }}}]}},
+ } as unknown as typeof window.siyuan;
+ const custom = block("NodeCustomBlock");
+ custom.dataset.info = "preview-test/test";
+ custom.dataset.content = "Preserve plugin content";
+ api.registerCustomBlockRoot(root, {disabled: () => false, update: (element: HTMLElement) => {
+ updates.push(element.dataset.nodeId);
+ }});
+ api.setCustomBlockRootReady(root, true);
+ api.activateCustomBlockPlugin("preview-test");
+ check.equal(renders, 1);
+ const customPreview = preview(custom);
+ await new Promise(resolve => setTimeout(resolve, 0));
+ api.customBlockRender(root);
+ check.equal(renders, 1, "plugin lifecycle observers cannot mount a writable preview");
+ check.equal(customPreview.textContent, "Preserve plugin content");
+ check.equal(customPreview.querySelector("button"), null);
+ check.equal(sourceSetter("Source can still change"), true);
+ await Promise.resolve();
+ check.deepEqual(updates, ["NodeCustomBlock"]);
+ check.equal(custom.dataset.content, "Source can still change");
+ // 已排队的插件回调也重新确认容器归属。
+ check.equal(sourceSetter("Queued change"), true);
+ custom.classList.add("list-mindmap__preview-block");
+ await Promise.resolve();
+ check.equal(sourceSetter("Detached identity"), false);
+ check.equal(updates.length, 1);
+ check.equal(custom.dataset.content, "Source can still change");
+ api.deactivateCustomBlockPlugin("preview-test");
+ api.unregisterCustomBlockRoot(root);
+
+ const html = block("NodeHTMLBlock", '<div class="protyle-icons"><span></span><span></span></div><div>HTML</div>');
+ const htmlPreview = preview(html);
+ htmlPreview.querySelector(".protyle-icons").remove();
+ api.htmlRender(root);
+ check.equal(html.firstElementChild.firstElementChild.getAttribute("aria-label"), "edit");
+ check.equal(htmlPreview.textContent, "HTML");
+ api.htmlRender(htmlPreview);
+
+ const embed = block("NodeBlockQueryEmbed");
+ embed.dataset.content = "select * from blocks limit 1";
+ const embedPreview = preview(embed);
+ api.blockRender(protyle, root);
+ api.blockRender(protyle, embedPreview);
+ check.equal(requests.length, 1);
+ check.equal(requests[0].data.embedBlockID, "NodeBlockQueryEmbed");
+ const database = block("NodeAttributeView", "<div>Database</div>");
+ database.className = "av";
+ database.dataset.avId = "database";
+ const databasePreview = preview(database);
+ database.dataset.render = "true";
+ await api.avRender(root, protyle);
+ await api.avRender(databasePreview, protyle);
+ check.deepEqual(api.getAVElements(protyle, "database"), [database], "database refresh excludes preview copies");
+
+ const chart = block("NodeCodeBlock", '<div _echarts_instance_="source-instance"><canvas></canvas></div>');
+ chart.dataset.subtype = "echarts";
+ preview(chart);
+ const disposedCharts: Element[] = [];
+ window.echarts = {dispose: (element: Element) => disposedCharts.push(element)} as unknown as typeof window.echarts;
+ api.refreshChartTheme(root);
+ check.deepEqual(disposedCharts, [chart.firstElementChild], "theme changes never dispose the source through a preview copy");
+ check.deepEqual(chartRefreshes, [chart]);
+
+ const table = block("NodeTable", "<table><tbody><tr><td>Cell</td></tr></tbody></table>" +
+ '<div class="protyle-action__table"></div>');
+ table.setAttribute("custom-pinthead", "true");
+ const tablePreview = preview(table);
+ const cell = table.querySelector("td");
+ check.equal(api.getCell(cell.firstChild), cell);
+ check.equal(api.getTableNode(cell), table);
+ check.equal(api.getCell(tablePreview.querySelector("td")), undefined);
+ check.equal(api.getTableNode(tablePreview.querySelector("td")), undefined);
+ const controls = Object.assign(new api.TablePreviewControl(), {
+ wysiwygElement: tablePreview, pinnedTableActions: new Map(),
+ pinnedTableResizeObserver: {observe: () => check.fail("Preview registered a pinned table control")},
+ getTableGridRect: () => check.fail("Preview registered table resize handles"),
+ });
+ check.equal(controls.getEdgeHover(0, 0), undefined);
+ controls.renderPinnedTableFrames();
+ check.equal(controls.pinnedTableActions.size, 0);
+
+ // 复杂块在编辑入口处保留原文,不进入会丢弃不支持内容的富文本净化流程。
+ const types = ["NodeTable", "NodeAttributeView", "NodeBlockQueryEmbed", "NodeCustomBlock", "NodeHTMLBlock",
+ "NodeIFrame", "NodeWidget", "NodeVideo", "NodeAudio", "NodeCallout", "NodeSuperBlock", "NodeTabs"];
+ for (const type of types) {
+ const item = block("NodeListItem");
+ item.innerHTML = `<div data-node-id="special" data-type="${type}" data-content="raw source">Keep content</div>`;
+ const host = document.createElement("div");
+ const original = item.outerHTML;
+ check.ok(api.getAVRichTextUnsupportedPasteBlocks(item.innerHTML, true).length, type);
+ check.equal(api.openListMindmapEditor({node: {element: item}, host, canEdit: () => true}), undefined);
+ check.equal(item.outerHTML, original, type);
+ check.equal(host.childElementCount, 0);
+ }
+ check.equal(messages.length, types.length);
+ check.deepEqual(api.getAVRichTextUnsupportedPasteBlocks('<div data-type="NodeParagraph"><img src="asset.png"></div>', true), []);
+ for (const type of ["NodeParagraph", "NodeBlockquote", "NodeMathBlock"]) {
+ check.deepEqual(api.getAVRichTextUnsupportedPasteBlocks(`<div data-type="${type}">Content</div>`, true), []);
+ }
+ for (const language of ["go", "mermaid", "echarts", "abc", "plantuml", "graphviz", "flowchart"]) {
+ const unsupported = api.getAVRichTextUnsupportedPasteBlocks(
+ `<div data-type="NodeCodeBlock" data-subtype="${language}">Code</div>`, true);
+ check.equal(unsupported.length, language === "go" ? 0 : 1, language);
+ }
+ root.remove();
+ return "Special block previews passed";
+};
+
+test("special block previews cannot acquire document writes or lose unsupported source content", {
+ skip: process.platform === "linux" && !process.env.DISPLAY && !process.env.WAYLAND_DISPLAY,
+ timeout: 20000,
+}, async () => {
+ const tableSource = createSourceFile("tableControl.ts", readFileSync(path.join(__dirname,
+ "../../util/tableControl.ts"), "utf8"), ScriptTarget.Latest, true);
+ const tableClass = tableSource.statements.find(isClassDeclaration);
+ const methods = tableClass.members.filter(member => ["getEdgeHover", "renderPinnedTableFrames"]
+ .includes(member.name?.getText(tableSource)));
+ assert.equal(methods.length, 2);
+ const source = compile(readFileSync(path.join(__dirname, "../../../plugin/customBlockRender.ts"), "utf8")) +
+ extract("../htmlRender.ts", ["htmlRender"]) + extract("../blockRender.ts", ["blockRender"]) +
+ extract("../chartRender.ts", ["refreshChartTheme"]) +
+ extract("../av/render.ts", ["avRender", "getAVElements"]) +
+ extract("../../util/tableControl.ts", ["getCell", "getTableNode"]) +
+ compile(`class TablePreviewControl {${methods.map(method => method.getText(tableSource)).join("\n")}}`) +
+ extract("../av/richText.ts", ["ALLOWED_BLOCK_TYPES", "isSupportedAVRichTextBlock", "getAVRichTextUnsupportedPasteBlocks"]) +
+ extract("../av/richTextValue.ts", ["EXECUTABLE_CODE_LANGUAGES", "isAVRichTextExecutableCodeLanguage"]) +
+ extract("editor.ts", ["nodeContent", "openListMindmapEditor"]);
+ const temporary = mkdtempSync(path.join(tmpdir(), "siyuan-mindmap-preview-"));
+ const script = path.join(temporary, "run.cjs");
+ writeFileSync(script, `const {app, BrowserWindow} = require("electron");
+app.setPath("userData", ${JSON.stringify(path.join(temporary, "profile"))});
+app.commandLine.appendSwitch("disable-gpu");
+app.whenReady().then(async () => {
+ const win = new BrowserWindow({show: false, webPreferences: {nodeIntegration: true, contextIsolation: false}});
+ try {
+ await win.loadURL("data:text/html,<html><body></body></html>");
+ await win.webContents.executeJavaScript("window.Lute = {UnEscapeHTMLStr: value => value}; void 0;");
+ console.log(await win.webContents.executeJavaScript(${JSON.stringify(
+ `const __name = value => value; (${cases.toString()})(${JSON.stringify(source)})`)}));
+ win.destroy();
+ app.exit(0);
+ } catch (error) {
+ console.error(error);
+ win.destroy();
+ app.exit(1);
+ }
+});`, "utf8");
+ const env = {...process.env};
+ delete env.ELECTRON_RUN_AS_NODE;
+ try {
+ const executable = require("electron") as unknown as string;
+ const result = await promisify(execFile)(executable, [script], {env, timeout: 15000, windowsHide: true});
+ assert.match(result.stdout, /Special block previews passed/);
+ } finally {
+ rmSync(temporary, {recursive: true, force: true});
+ }
+});
diff --git a/app/src/protyle/render/listMindmap/toggle.test.ts b/app/src/protyle/render/listMindmap/toggle.test.ts
index 4f4ca64b1e..c721dd90b9 100644
--- a/app/src/protyle/render/listMindmap/toggle.test.ts
+++ b/app/src/protyle/render/listMindmap/toggle.test.ts
@@ -18,6 +18,7 @@ const setup = () => {
const attribute = "custom-sy-list-mindmap";
const attrs = new Map([[attribute, "1"]]);
const list = {
+ isConnected: true,
dataset: {type: "NodeList", nodeId: "source-list"},
closest: (selector: string) => selector === ".protyle-wysiwyg" ? root : embed,
getAttribute: (name: string) => attrs.get(name),
@@ -64,3 +65,16 @@ test("read-only, history and lightweight editors cannot persist embedded view ch
assert.equal(operations.length, 0);
}
});
+
+test("removed lists and blocks without IDs cannot submit view changes", () => {
+ for (const removed of [false, true]) {
+ const {list, owner, api, operations} = setup();
+ if (removed) {
+ list.isConnected = false;
+ } else {
+ list.dataset.nodeId = "";
+ }
+ api.toggleListMindmap(owner, list);
+ assert.equal(operations.length, 0);
+ }
+});
diff --git a/app/src/protyle/render/listMindmap/view.ts b/app/src/protyle/render/listMindmap/view.ts
index 40fefb471e..79e11216f9 100644
--- a/app/src/protyle/render/listMindmap/view.ts
+++ b/app/src/protyle/render/listMindmap/view.ts
@@ -12,6 +12,7 @@ import {mathRender} from "../mathRender";
import {getAVRichTextSafeURL} from "../av/richTextValue";
import {Constants} from "../../../constants";
import {findMindmapDrop} from "./drop";
+import {destroyTabsRender, tabsRender} from "../tabsRender";
export interface ListMindmapViewOptions {
host: HTMLElement;
@@ -38,6 +39,8 @@ export interface ListMindmapViewOptions {
onFold?: (id: string) => void;
onTaskToggle?: (id: string, cycle?: boolean) => void;
onTaskMenu?: (id: string, anchor: HTMLElement) => void;
+ onTabTaskToggle?: (id: string, itemId: string) => void;
+ onTabTaskMenu?: (id: string, itemId: string, anchor: HTMLElement) => void;
isTaskCycle?: (event: KeyboardEvent) => boolean;
onUndo?: () => void;
onRedo?: () => void;
@@ -89,6 +92,7 @@ export class ListMindmapView {
private readonly zoomLabel: HTMLSpanElement;
private readonly zoomSlider = createElement("input", "b3-slider");
private readonly nodeElements = new Map<string, HTMLDivElement>();
+ private readonly previewID = `list-mindmap-${Lute.NewNodeID()}-`;
private readonly relationElements = new Map<string, HTMLButtonElement>();
private readonly buttons = new Map<string, HTMLButtonElement>();
private readonly folded = new Map<string, boolean>();
@@ -341,7 +345,7 @@ export class ListMindmapView {
task.disabled = value;
}
});
- this.updateSelection();
+ this.update(this.model);
}
private createToolbar() {
@@ -396,6 +400,7 @@ export class ListMindmapView {
}
this.nodeElements.forEach((element, id) => {
if (!model.nodes.has(id)) {
+ destroyTabsRender(this.getContentHost(id));
this.resizeObserver.unobserve(element);
element.remove();
this.nodeElements.delete(id);
@@ -446,14 +451,35 @@ export class ListMindmapView {
fold.querySelector("span").textContent = String(descendants.get(id));
if (id !== this.editingId) {
const content = this.getContentHost(id);
+ const activeTabs = new Map<string, string>();
+ content.querySelectorAll<HTMLElement>('.tab-item[data-tabs-hidden="false"]').forEach(item => {
+ activeTabs.set(item.parentElement.id, item.id);
+ });
+ destroyTabsRender(content);
content.replaceChildren();
+ const sourceTabIDs = new Map<string, string>();
if (node.virtual) {
content.textContent = this.model.metadata.rootTitle || "";
} else {
node.contentBlocks.forEach((block) => {
const clone = block.cloneNode(true) as HTMLElement;
- clone.querySelectorAll(".protyle-attr, .protyle-action, .protyle-icons, .list-mindmap").forEach(item => item.remove());
+ const sourceCanvases = block.querySelectorAll("canvas");
+ clone.querySelectorAll("canvas").forEach((canvas, index) => {
+ const source = sourceCanvases[index];
+ if (source.width && source.height) {
+ canvas.getContext("2d")?.drawImage(source, 0, 0);
+ }
+ });
+ const previewTabIDs = new Map<string, string>();
+ clone.querySelectorAll(".protyle-attr, .protyle-action, .protyle-action__table, .protyle-icons, .list-mindmap")
+ .forEach(item => item.remove());
[clone, ...Array.from(clone.querySelectorAll<HTMLElement>("*"))].forEach((item) => {
+ // 页签预览使用独立 DOM 标识切换正文,不携带可提交事务的块身份。
+ if (["NodeTabs", "NodeTabItem"].includes(item.getAttribute("data-type"))) {
+ item.id = this.previewID + item.getAttribute("data-node-id");
+ previewTabIDs.set(item.getAttribute("data-node-id"), item.id);
+ sourceTabIDs.set(item.id, item.getAttribute("data-node-id"));
+ }
if (item.hasAttribute("data-node-id")) {
item.classList.add("list-mindmap__preview-block");
}
@@ -465,7 +491,16 @@ export class ListMindmapView {
item.removeAttribute("data-node-id");
item.removeAttribute("spellcheck");
item.removeAttribute("draggable");
+ // 画布保留显示快照,实例标识不能使预览刷新或销毁源图表。
+ item.removeAttribute("_echarts_instance_");
});
+ [clone, ...Array.from(clone.querySelectorAll<HTMLElement>('[data-type="NodeTabs"]'))]
+ .forEach(tabs => {
+ const active = activeTabs.get(tabs.id) || previewTabIDs.get(tabs.getAttribute("tabs-active-id"));
+ if (active) {
+ tabs.setAttribute("tabs-active-id", active);
+ }
+ });
content.append(clone);
});
}
@@ -475,6 +510,27 @@ export class ListMindmapView {
!content.querySelector("img, svg, video, audio, iframe, canvas, hr, [data-content]");
content.classList.toggle("list-mindmap__content--empty", empty);
content.dataset.placeholder = this.label("listMindmapPlaceholder");
+ if (content.querySelector('.tabs[data-type="NodeTabs"]')) {
+ tabsRender(content, {
+ readonly: () => true,
+ taskReadonly: () => !!this.options.readOnly || !this.options.onTabTaskToggle,
+ taskLabel: this.label("taskList"),
+ task: item => {
+ const itemId = sourceTabIDs.get(item.id);
+ if (!this.options.readOnly && itemId) {
+ this.options.onTabTaskToggle?.(id, itemId);
+ }
+ },
+ taskMenu: item => {
+ const itemId = sourceTabIDs.get(item.id);
+ const anchor = content.querySelector<HTMLElement>(`.tabs-task[data-tab-id="${item.id}"]`);
+ if (!this.options.readOnly && itemId && anchor) {
+ this.options.onTabTaskMenu?.(id, itemId, anchor);
+ }
+ },
+ shown: () => this.refreshLayout(),
+ });
+ }
// 副本独立渲染公式,避免源节点的异步渲染完成后脑图仍保留未渲染内容。
void mathRender(content, this.options.cdn)?.then(() => this.refreshLayout()).catch(error => console.error(error));
}
@@ -507,6 +563,7 @@ export class ListMindmapView {
}
this.editingId = id;
if (id) {
+ destroyTabsRender(this.getContentHost(id));
this.selectNode(id);
this.nodeElements.get(id)?.classList.add("list-mindmap__node--editing");
}
@@ -641,7 +698,7 @@ export class ListMindmapView {
this.fitPrint();
} else if (this.initialFit) {
this.initialFit = false;
- this.fit();
+ this.fit(1);
} else {
this.draw();
}
@@ -1192,7 +1249,7 @@ export class ListMindmapView {
clearTimeout(this.linkTimer);
this.suppressLinkClick = false;
const target = event.target as HTMLElement;
- if (event.button !== 0 || target.closest("button, input, select, textarea, .list-mindmap__node--editing")) {
+ if (event.button !== 0 || target.closest("button, input, select, textarea, audio, video, iframe, .list-mindmap__node--editing")) {
return;
}
const element = target.closest<HTMLElement>(".list-mindmap__node");
@@ -1544,7 +1601,7 @@ export class ListMindmapView {
this.editRelationLabel(event);
return;
}
- if (target.closest("button, input, select, .list-mindmap__node--editing")) {
+ if (target.closest("button, input, select, audio, video, iframe, .list-mindmap__node--editing")) {
return;
}
const id = target.closest<HTMLElement>(".list-mindmap__node")?.dataset.mindmapId;
@@ -1749,7 +1806,7 @@ export class ListMindmapView {
this.draw();
}
- public fit() {
+ public fit(maxScale = 2.5) {
const width = this.viewport.clientWidth;
const height = this.viewport.clientHeight;
if (!this.positions.size || !width || !height) {
@@ -1763,7 +1820,7 @@ export class ListMindmapView {
const insetBottom = 42;
const availableWidth = Math.max(1, width - 48);
const availableHeight = Math.max(1, height - insetTop - insetBottom);
- this.scale = Math.min(2.5, Math.max(.15, Math.min(availableWidth / Math.max(1, right - left),
+ this.scale = Math.min(maxScale, Math.max(.15, Math.min(availableWidth / Math.max(1, right - left),
availableHeight / Math.max(1, bottom - top))));
this.offsetX = width / 2 - (left + right) * this.scale / 2;
this.offsetY = insetTop + availableHeight / 2 - (top + bottom) * this.scale / 2;
@@ -1772,7 +1829,7 @@ export class ListMindmapView {
private keyDown = (event: KeyboardEvent) => {
const target = event.target as HTMLElement;
- if (event.isComposing || target.closest("input, textarea, select, .list-mindmap__node--editing")) {
+ if (event.isComposing || target.closest("input, textarea, select, audio, video, iframe, .list-mindmap__node--editing")) {
return;
}
if (this.pointer?.relation && event.key !== "Escape") {
@@ -2032,6 +2089,7 @@ export class ListMindmapView {
this.resizeObserver.disconnect();
this.disposers.forEach(dispose => dispose());
this.exitFullscreen();
+ this.nodeElements.forEach((_element, id) => destroyTabsRender(this.getContentHost(id)));
this.nodeElements.clear();
this.relationElements.clear();
this.options.host.replaceChildren();
diff --git a/app/src/protyle/render/mindmapRender.ts b/app/src/protyle/render/mindmapRender.ts
index cb5ad8006a..183dbe4ff5 100644
--- a/app/src/protyle/render/mindmapRender.ts
+++ b/app/src/protyle/render/mindmapRender.ts
@@ -1,92 +1,8 @@
-import {addScript} from "../util/addScript";
-import {Constants} from "../../constants";
-import {hasClosestByClassName} from "../util/hasClosest";
-import {genIconHTML} from "./util";
-import {escapeHtml} from "../../util/escape";
-import {getHostCapabilities} from "../../util/hostCapabilities";
import {listMindmapRender} from "./listMindmap/render";
+import {renderLegacyMindmaps} from "./listMindmap/legacy";
-export const mindmapRender = (element: Element, cdn = Constants.PROTYLE_CDN) => {
+// 保留插件和导出页面的公开入口,统一使用列表脑图显示。
+export const mindmapRender = (element: Element, cdn?: string) => {
listMindmapRender(element, cdn);
- let mindmapElements: Element[] | NodeListOf<Element> = [];
- if (element.getAttribute("data-subtype") === "mindmap" && element.getAttribute("data-render") !== "true") {
- mindmapElements = [element];
- } else {
- mindmapElements = element.querySelectorAll('[data-subtype="mindmap"]:not([data-render="true"])');
- }
- if (mindmapElements.length === 0) {
- return;
- }
- addScript(`${cdn}/js/echarts/echarts.min.js?v=0.0.0`, "protyleEchartsScript").then(() => {
- const wysiswgElement = hasClosestByClassName(element, "protyle-wysiwyg", true);
- let width: number = undefined;
- if (wysiswgElement && wysiswgElement.clientWidth > 0 && mindmapElements[0].firstElementChild.clientWidth === 0 && wysiswgElement.firstElementChild) {
- width = wysiswgElement.firstElementChild.clientWidth;
- }
- mindmapElements.forEach((e: HTMLDivElement) => {
- e.setAttribute("data-render", "true");
- if (!e.firstElementChild.classList.contains("protyle-icons")) {
- e.insertAdjacentHTML("afterbegin", genIconHTML(wysiswgElement));
- }
- const renderElement = e.firstElementChild.nextElementSibling as HTMLElement;
- if (!e.getAttribute("data-content")) {
- renderElement.innerHTML = `<span style="position: absolute;left:0;top:0;width: 1px;">${Constants.ZWSP}</span>`;
- return;
- }
- try {
- if (!renderElement.lastElementChild || renderElement.childElementCount === 1) {
- renderElement.innerHTML = `<span style="position: absolute;left:0;top:0;width: 1px;">${Constants.ZWSP}</span><div style="height:${e.style.height || "420px"}" contenteditable="false"></div>`;
- } else {
- renderElement.lastElementChild.classList.remove("ft__error");
- }
- window.echarts.init(renderElement.lastElementChild, window.siyuan.config.appearance.mode === 1 ? "dark" : undefined, {
- width,
- }).setOption({
- series: [
- {
- data: [JSON.parse(Lute.EChartsMindmapStr(Lute.UnEscapeHTMLStr(e.getAttribute("data-content"))))],
- initialTreeDepth: -1,
- itemStyle: {
- borderWidth: 0,
- color: "#4285f4",
- },
- label: {
- backgroundColor: "#f6f8fa",
- borderColor: "#d1d5da",
- borderRadius: 6,
- borderWidth: 0.5,
- color: "#586069",
- lineHeight: 20,
- offset: [-5, 0],
- padding: [0, 5],
- position: "insideRight",
- },
- lineStyle: {
- color: "#d1d5da",
- width: 1,
- },
- roam: true,
- symbol: (value: number, params: { data?: { children?: string } }) => {
- if (params?.data?.children) {
- return "circle";
- } else {
- return "path://";
- }
- },
- type: "tree",
- },
- ],
- tooltip: {
- ...(getHostCapabilities().remoteKernel ? {renderMode: "richText"} : {}),
- trigger: "item",
- triggerOn: "mousemove",
- },
- backgroundColor: "transparent",
- });
- } catch (error) {
- window.echarts.dispose(renderElement.lastElementChild);
- renderElement.innerHTML = `<span style="position: absolute;left:0;top:0;width: 1px;">${Constants.ZWSP}</span><div class="ft__error" style="height:${e.style.height || "420px"}" contenteditable="false">Mindmap render error: <br>${escapeHtml(String(error))}</div>`;
- }
- });
- });
+ renderLegacyMindmaps(element, cdn);
};
diff --git a/app/src/protyle/render/tabsAttributes.ts b/app/src/protyle/render/tabsAttributes.ts
index 1916f0b48c..95799d86fc 100644
--- a/app/src/protyle/render/tabsAttributes.ts
+++ b/app/src/protyle/render/tabsAttributes.ts
@@ -3,9 +3,10 @@ interface ITabsAttributesOptions {
open: (block: HTMLElement, focus: string) => void;
}
-export const clearTabsAttributes = (root: Element) => {
- root.querySelectorAll(".tabs-attributes").forEach(button => button.remove());
- root.querySelectorAll("[data-tabs-attributes]").forEach(block => block.removeAttribute("data-tabs-attributes"));
+export const clearTabsAttributes = (root: Element, owns: (element: Element) => boolean = () => true) => {
+ Array.from(root.querySelectorAll(".tabs-attributes")).filter(owns).forEach(button => button.remove());
+ Array.from(root.querySelectorAll("[data-tabs-attributes]")).filter(owns)
+ .forEach(block => block.removeAttribute("data-tabs-attributes"));
};
// 属性控件仅投影原始属性,保留块内属性节点供事务、复制及导出读取。
diff --git a/app/src/protyle/render/tabsKeyboard.test.ts b/app/src/protyle/render/tabsKeyboard.test.ts
index bc598259f7..be65a19197 100644
--- a/app/src/protyle/render/tabsKeyboard.test.ts
+++ b/app/src/protyle/render/tabsKeyboard.test.ts
@@ -32,10 +32,10 @@ const loadHandler = (element: "button" | "task", globals: Record<string, unknown
return exports.handler;
};
-const fixture = (readonly: boolean, vertical = false) => {
+const fixture = (readonly: boolean, vertical = false, taskReadonly = readonly) => {
const calls: string[] = [];
const globals = {
- ids: ["a", "b"], items: [{}], item: {}, itemID: () => "a", type: "keydown", readonly,
+ ids: ["a", "b"], items: [{}], item: {}, itemID: () => "a", type: "keydown", readonly, taskReadonly,
tabs: {
getBoundingClientRect: () => ({top: -1}),
getAttribute: () => vertical ? "vertical" : "horizontal",
@@ -113,4 +113,7 @@ test("readonly task activation cannot toggle the task or select the parent tab",
const tab = fixture(true);
assert.equal(tab.dispatch("Enter").propagationStopped, true);
assert.deepEqual(tab.calls, ["select", "activate", "panel-start"]);
+ const delegatedTask = fixture(true, false, false);
+ assert.equal(delegatedTask.dispatch("Enter", true).propagationStopped, true);
+ assert.deepEqual(delegatedTask.calls, ["task"]);
});
diff --git a/app/src/protyle/render/tabsRender.ts b/app/src/protyle/render/tabsRender.ts
index 8272906d69..533357f807 100644
--- a/app/src/protyle/render/tabsRender.ts
+++ b/app/src/protyle/render/tabsRender.ts
@@ -5,6 +5,7 @@ import {clearTabsAttributes, renderTabsAttributes} from "./tabsAttributes";
export interface ITabsRenderOptions {
readonly?: (tabs?: Element) => boolean;
+ taskReadonly?: (tabs?: Element) => boolean;
label?: string;
addLabel?: string;
select?: (tabs: HTMLElement, id: string) => void;
@@ -82,10 +83,21 @@ export const tabsRender = (element: Element, options: ITabsRenderOptions = {}) =
existing.render();
return;
}
+ const owns = (target: Element) => {
+ if (target.closest(".protyle-wysiwyg") !== element.closest(".protyle-wysiwyg")) {
+ return false;
+ }
+ for (let parent = target; parent && parent !== element; parent = parent.parentElement) {
+ if (roots.has(parent)) {
+ return false;
+ }
+ }
+ return element.contains(target);
+ };
const getTabs = () => [
...(element.matches('.tabs[data-type="NodeTabs"]') ? [element as HTMLElement] : []),
...Array.from(element.querySelectorAll<HTMLElement>('.tabs[data-type="NodeTabs"]')),
- ];
+ ].filter(owns);
let scheduled = false;
let destroyed = false;
const sizes = new WeakMap<Element, string>();
@@ -110,6 +122,9 @@ export const tabsRender = (element: Element, options: ITabsRenderOptions = {}) =
}
let changed = false;
element.querySelectorAll<HTMLElement>('.tab-item[data-tabs-editing="true"]').forEach(item => {
+ if (!owns(item)) {
+ return;
+ }
const title = getTabTitle(item);
const selectionInTitle = title?.contains(selection?.anchorNode) &&
(active === element || element.contains(active));
@@ -142,7 +157,7 @@ export const tabsRender = (element: Element, options: ITabsRenderOptions = {}) =
controller.render();
}
const state = states.get(tabs);
- if (!state || !getTabItems(tabs).some(item => itemID(item) === id)) {
+ if (!state || state.owner !== controller || !getTabItems(tabs).some(item => itemID(item) === id)) {
return;
}
if (state.active !== id) {
@@ -164,7 +179,7 @@ export const tabsRender = (element: Element, options: ITabsRenderOptions = {}) =
const focusedAttributes = document.activeElement?.closest<HTMLElement>(".tabs-attributes");
const focusedAttributesID = focusedAttributes && element.contains(focusedAttributes) ?
focusedAttributes.dataset.blockId : undefined;
- clearTabsAttributes(element);
+ clearTabsAttributes(element, owns);
const shown: HTMLElement[] = [];
getTabs().forEach(tabs => {
const items = getTabItems(tabs);
@@ -194,6 +209,7 @@ export const tabsRender = (element: Element, options: ITabsRenderOptions = {}) =
}
state.active = resolveTabID(ids, state.active);
const readonly = controller.options.readonly?.(tabs) ?? true;
+ const taskReadonly = controller.options.taskReadonly?.(tabs) ?? readonly;
const narrow = tabs.clientWidth < 420;
const vertical = tabs.getAttribute("tabs-position") === "left" && !narrow;
tabs.setAttribute("data-tabs-orientation", vertical ? "vertical" : "horizontal");
@@ -221,7 +237,7 @@ export const tabsRender = (element: Element, options: ITabsRenderOptions = {}) =
});
header.addEventListener("selectstart", event => event.preventDefault());
}
- const signature = JSON.stringify([readonly, ...items.map(item => [itemID(item),
+ const signature = JSON.stringify([readonly, taskReadonly, ...items.map(item => [itemID(item),
getTabTask(item), item.dataset.tabsEditing === "true" ? null : getTabTitle(item)?.innerHTML])]);
let previousScroll: {left: number, top: number};
if (state.signature !== signature || !header.firstElementChild) {
@@ -295,9 +311,9 @@ export const tabsRender = (element: Element, options: ITabsRenderOptions = {}) =
task.setAttribute("role", "checkbox");
task.setAttribute("aria-label", controller.options.taskLabel || "Task");
task.setAttribute("aria-checked", String(marker !== " "));
- task.setAttribute("aria-disabled", String(readonly));
+ task.setAttribute("aria-disabled", String(taskReadonly));
task.setAttribute("data-task", marker);
- task.tabIndex = readonly ? -1 : 0;
+ task.tabIndex = taskReadonly ? -1 : 0;
task.addEventListener("pointerdown", event => event.stopPropagation());
task.addEventListener("mousedown", event => {
event.preventDefault();
@@ -328,10 +344,10 @@ export const tabsRender = (element: Element, options: ITabsRenderOptions = {}) =
if (controller.options.menu) {
controller.select(tabs, itemID(item), true);
controller.options.menu(tabs, item, button);
- } else if (!readonly) {
+ } else if (!taskReadonly) {
controller.options.taskMenu?.(item);
}
- } else if (!readonly && type !== "dblclick") {
+ } else if (!taskReadonly && type !== "dblclick") {
controller.options.task?.(item);
}
}));
@@ -535,7 +551,7 @@ export const tabsRender = (element: Element, options: ITabsRenderOptions = {}) =
destroyed = true;
controller.observer.disconnect();
controller.resize.disconnect();
- clearTabsAttributes(element);
+ clearTabsAttributes(element, owns);
element.removeEventListener("focusout", onFocusOut);
element.removeEventListener("scroll", schedule, true);
document.removeEventListener("scroll", onAncestorScroll, true);
diff --git a/app/src/protyle/toolbar/index.ts b/app/src/protyle/toolbar/index.ts
index 043a4b1dbc..382a2b3937 100644
--- a/app/src/protyle/toolbar/index.ts
+++ b/app/src/protyle/toolbar/index.ts
@@ -1501,8 +1501,8 @@ export class Toolbar {
}
});
}
- let title = "HTML";
- let placeholder = "";
+ let title = types.includes("NodeCodeBlock") ? window.siyuan.languages.code : "HTML";
+ const placeholder = "";
const isInlineMemo = types.includes("inline-memo");
switch (renderElement.getAttribute("data-subtype")) {
case "abc":
@@ -1520,12 +1520,6 @@ export class Toolbar {
case "mermaid":
title = "Mermaid";
break;
- case "mindmap":
- placeholder = `- foo
- - bar
-- baz`;
- title = window.siyuan.languages.mindmap;
- break;
case "plantuml":
title = "UML";
break;
diff --git a/app/src/protyle/util/destroy.ts b/app/src/protyle/util/destroy.ts
index 144dbb1276..b6276de105 100644
--- a/app/src/protyle/util/destroy.ts
+++ b/app/src/protyle/util/destroy.ts
@@ -1,5 +1,6 @@
import {destroyTabsRender} from "../render/tabsRender";
import {destroyListMindmaps} from "../render/listMindmap";
+import {cancelLegacyMindmapMigration} from "../render/listMindmap/migrate";
import {hideElements} from "../ui/hideElements";
import {isSupportCSSHL} from "../render/searchMarkRender";
import {destroyAIEditor} from "../../ai/editor";
@@ -17,6 +18,7 @@ export const destroy = (protyle: IProtyle) => {
return;
}
destroyListMindmaps(protyle);
+ cancelLegacyMindmapMigration(protyle);
invalidateFocusFoldRequests(protyle);
unregisterViewFoldContext(protyle);
destroyTrackedRanges(protyle);
diff --git a/app/src/protyle/util/onGet.ts b/app/src/protyle/util/onGet.ts
index 43be420777..810ee4a567 100644
--- a/app/src/protyle/util/onGet.ts
+++ b/app/src/protyle/util/onGet.ts
@@ -3,6 +3,7 @@ import {Constants} from "../../constants";
import {hideElements} from "../ui/hideElements";
import {fetchPost} from "../../util/fetch";
import {processRender} from "./processCode";
+import {migrateLegacyMindmapsBeforeRender} from "../render/listMindmap/migrate";
import {highlightRender} from "../render/highlightRender";
import {blockRender} from "../render/blockRender";
import {revealTabsForTarget} from "../render/tabsRender";
@@ -153,6 +154,7 @@ export const onGet = (options: {
isSyncing: options.data.data.isSyncing,
refreshHeadingNumbers,
afterCB: options.afterCB,
+ isValid: options.isValid,
scrollPosition: options.scrollPosition,
focusAfterZoom: options.focusAfterZoom,
suppressFocus: options.suppressFocus,
@@ -172,6 +174,7 @@ export const onGet = (options: {
isSyncing: options.data.data.isSyncing,
refreshHeadingNumbers,
afterCB: options.afterCB,
+ isValid: options.isValid,
scrollPosition: options.scrollPosition,
focusAfterZoom: options.focusAfterZoom,
suppressFocus: options.suppressFocus,
@@ -204,6 +207,7 @@ export const onGet = (options: {
isSyncing: options.data.data.isSyncing,
refreshHeadingNumbers,
afterCB: options.afterCB,
+ isValid: options.isValid,
scrollPosition: options.scrollPosition,
focusAfterZoom: options.focusAfterZoom,
suppressFocus: options.suppressFocus,
@@ -238,7 +242,16 @@ const setHTML = (options: {
afterCB?: () => void,
focusAfterZoom?: boolean,
suppressFocus?: boolean,
+ isValid?: () => boolean,
}, protyle: IProtyle) => {
+ if (options.isValid && !options.isValid()) {
+ return;
+ }
+ if (!options.isSyncing && migrateLegacyMindmapsBeforeRender(protyle, options.content, options.action || [], content => {
+ setHTML({...options, content}, protyle);
+ })) {
+ return;
+ }
if (protyle.contentElement.classList.contains("fn__none") && protyle.wysiwyg.element.innerHTML !== "") {
return;
}
diff --git a/app/src/protyle/util/resize.ts b/app/src/protyle/util/resize.ts
index eedd62c06e..7ad6e92a88 100644
--- a/app/src/protyle/util/resize.ts
+++ b/app/src/protyle/util/resize.ts
@@ -61,7 +61,7 @@ export const resize = (protyle: IProtyle) => {
});
if (abs.width > MIN_ABS || isNaN(abs.width)) {
if (typeof window.echarts !== "undefined") {
- protyle.wysiwyg.element.querySelectorAll('[data-subtype="echarts"], [data-subtype="mindmap"]').forEach((chartItem: HTMLElement) => {
+ protyle.wysiwyg.element.querySelectorAll('[data-subtype="echarts"]').forEach((chartItem: HTMLElement) => {
const chartInstance = window.echarts.getInstanceById(chartItem.querySelector("[_echarts_instance_]").getAttribute("_echarts_instance_"));
if (chartInstance) {
chartInstance.resize();
diff --git a/app/src/protyle/util/tableControl.ts b/app/src/protyle/util/tableControl.ts
index 5d567e07ca..1693c18dae 100644
--- a/app/src/protyle/util/tableControl.ts
+++ b/app/src/protyle/util/tableControl.ts
@@ -114,12 +114,13 @@ const getCell = (target: EventTarget | Node) => {
const element = target instanceof Element ? target : (target as Node)?.parentElement;
const cell = element?.closest?.("th, td") as HTMLTableCellElement;
const editor = element?.closest?.(".table__cell-editor");
- return cell && (element.closest(".protyle-wysiwyg") === cell.closest(".protyle-wysiwyg") ||
+ return cell && !cell.closest(".list-mindmap__preview-block") &&
+ (element.closest(".protyle-wysiwyg") === cell.closest(".protyle-wysiwyg") ||
editor?.parentElement === cell) ? cell : undefined;
};
const getTableNode = (cell: HTMLTableCellElement) => {
- if (cell?.closest(".protyle-custom")) {
+ if (cell?.closest(".protyle-custom, .list-mindmap__preview-block")) {
return;
}
return cell?.closest<HTMLElement>('[data-type="NodeTable"]');
@@ -1133,7 +1134,7 @@ export class TableControl {
private getEdgeHover(clientX: number, clientY: number) {
const candidates: ITableEdgeHover[] = [];
this.wysiwygElement.querySelectorAll<HTMLTableElement>('[data-type="NodeTable"] table').forEach(table => {
- if (table.closest(".protyle-custom")) {
+ if (table.closest(".protyle-custom, .list-mindmap__preview-block")) {
return;
}
const gridRect = this.getTableGridRect(table);
@@ -1296,7 +1297,7 @@ export class TableControl {
const actions = new Map<HTMLTableElement, HTMLElement>();
this.wysiwygElement.querySelectorAll<HTMLTableElement>(
'[data-type="NodeTable"][custom-pinthead="true"] table').forEach(table => {
- if (table.closest(".protyle-custom")) {
+ if (table.closest(".protyle-custom, .list-mindmap__preview-block")) {
return;
}
const action = table.nextElementSibling as HTMLElement;
diff --git a/app/src/protyle/wysiwyg/tabs.ts b/app/src/protyle/wysiwyg/tabs.ts
index ade22f3e17..98a0e1a52e 100644
--- a/app/src/protyle/wysiwyg/tabs.ts
+++ b/app/src/protyle/wysiwyg/tabs.ts
@@ -38,11 +38,13 @@ export const setTabTask = (protyle: IProtyle, item: HTMLElement, marker: string)
};
const canEdit = (protyle: IProtyle, element: Element) => !protyle.disabled &&
- !protyle.options.action.includes(Constants.CB_GET_HISTORY) && !element.closest(".protyle-wysiwyg__embed");
+ !protyle.options.action.includes(Constants.CB_GET_HISTORY) &&
+ !element.closest(".protyle-wysiwyg__embed, .list-mindmap__preview-block") &&
+ element.closest(".protyle-wysiwyg") === protyle.wysiwyg.element;
// 同一事务提交受影响的最外层容器,嵌套移动时避免父子更新相互覆盖。
const changeTabs = (protyle: IProtyle, elements: HTMLElement[], change: () => void) => {
- if (elements.some(element => !canEdit(protyle, element))) {
+ if (elements.some(element => !element.dataset.nodeId || !canEdit(protyle, element))) {
return;
}
const roots = Array.from(new Set(elements)).filter(element =>
diff --git a/app/src/types/api/index.d.ts b/app/src/types/api/index.d.ts
index 0307b24108..ec6ed0d941 100644
--- a/app/src/types/api/index.d.ts
+++ b/app/src/types/api/index.d.ts
@@ -1288,6 +1288,10 @@ export type Login2faEnvelope = { "code": number; "data": ({ "code": number; "msg
export type MarkdownHTMLRequestInput = { "markdown": string; "mode"?: string | null; };
+export type MigrateLegacyMindmapsData = { "blocks": Array<BlockDOMData> | null; "converted": number; };
+
+export type MigrateLegacyMindmapsRequestInput = { "id": string; "notebook": string; };
+
export type MoveBlockRequestInput = { "id": string; "parentID"?: string | null; "previousID"?: string | null; };
export type NetImageAssetsRequestInput = { "id": string; "url"?: string | null; };
@@ -3443,6 +3447,11 @@ export interface APIPOSTRoutes {
response: { "code": 0; "data": Array<BlockTransaction | null> | null; "msg": string; } | { "code": -1; "data": { "closeTimeout": number; } | null; "msg": string; };
body: "json";
};
+ "/api/block/migrateLegacyMindmaps": {
+ request: MigrateLegacyMindmapsRequestInput;
+ response: { "code": 0; "data": MigrateLegacyMindmapsData; "msg": string; } | { "code": -1; "data": { "closeTimeout": number; } | null; "msg": string; };
+ body: "json";
+ };
"/api/block/moveBlock": {
request: MoveBlockRequestInput;
response: { "code": 0; "data": null; "msg": string; } | { "code": -1; "data": { "closeTimeout": number; } | null; "msg": string; };
diff --git a/app/tests/taskStatus.test.js b/app/tests/taskStatus.test.js
index 82831e8d4a..d793ddb40e 100644
--- a/app/tests/taskStatus.test.js
+++ b/app/tests/taskStatus.test.js
@@ -79,7 +79,7 @@ const cases = async source => {
let lastTransaction;
const api = new Function("Constants", "transaction", "updateTransaction", "dayjs", "getParentBlock",
"getPreviousBlockSibling", "getTopAloneElement", source.actions +
- "; return {getTabTask, hasTabsTasks, preserveCopiedTabTask, wrapPastedTabItems, moveTo, moveTab, toggleTabsTasks, setTabTask, setTaskListItemMarker, toggleTaskListItem};")(
+ "; return {canEdit, getTabTask, hasTabsTasks, preserveCopiedTabTask, wrapPastedTabItems, moveTo, moveTab, toggleTabsTasks, setTabTask, setTaskListItemMarker, toggleTaskListItem};")(
{CB_GET_HISTORY: "history", ATTRIBUTE_EDITING: "data-editing", ZWSP: "\u200b",
CUSTOM_SY_LIST_MINDMAP: "custom-sy-list-mindmap",
CUSTOM_SY_LIST_MINDMAP_DATA: "custom-sy-list-mindmap-data"},
@@ -251,6 +251,7 @@ const cases = async source => {
api.setTabTask(protyle, item, "/");
check.equal(item.getAttribute("tabs-task"), "/");
apply(lastTransaction.backward);
+ from = find(from.dataset.nodeId);
item = from.querySelectorAll(":scope > .tab-item")[1];
check.equal(item.hasAttribute("tabs-task"), false);
api.toggleTabsTasks(protyle, from);
@@ -410,6 +411,39 @@ const cases = async source => {
check.equal(menuTarget, items[1]);
check.equal(api.getTabTask(items[1]), "?");
}
+ // 展示副本可以切换页签,但任务操作不能提交空块 ID;内嵌编辑器由自身接管。
+ const preview = from.cloneNode(true);
+ preview.classList.add("list-mindmap__preview-block");
+ preview.querySelectorAll(".tabs-header, .tabs-divider").forEach(element => element.remove());
+ [preview, ...preview.querySelectorAll("[data-node-id]")].forEach(element => element.removeAttribute("data-node-id"));
+ const previewItems = Array.from(preview.querySelectorAll(":scope > .tab-item"));
+ previewItems.forEach((item, index) => { item.id = `preview-tab-${index}`; });
+ root.append(preview);
+ const options = {readonly: tabs => !api.canEdit(protyle, tabs),
+ task: entry => api.setTabTask(protyle, entry, "X")};
+ renderer.tabsRender(root, options);
+ const previewBefore = previewItems[0].getAttribute("tabs-task");
+ lastTransaction = undefined;
+ preview.querySelector(".tabs-task").click();
+ api.setTabTask(protyle, previewItems[0], "X");
+ check.equal(lastTransaction, undefined);
+ check.equal(previewItems[0].getAttribute("tabs-task"), previewBefore);
+ preview.querySelectorAll(".tabs-tab")[1].click();
+ check.equal(previewItems[1].getAttribute("data-tabs-hidden"), "false");
+ check.equal(previewItems[0].getAttribute("data-tabs-hidden"), "true");
+ const inner = document.createElement("div");
+ inner.className = "protyle-wysiwyg";
+ inner.innerHTML = lute.Md2BlockDOM(markdown);
+ root.append(inner);
+ const innerBefore = inner.innerHTML;
+ renderer.tabsRender(root, options);
+ check.equal(inner.innerHTML, innerBefore);
+ const innerOwner = {...protyle, wysiwyg: {element: inner}};
+ renderer.tabsRender(inner, {readonly: tabs => !api.canEdit(innerOwner, tabs),
+ task: entry => api.setTabTask(innerOwner, entry, "X")});
+ inner.querySelector(".tabs-task").click();
+ check.ok(lastTransaction.forward[0].id);
+ renderer.destroyTabsRender(inner);
renderer.destroyTabsRender(root);
root.remove();
return "Task status cases passed";
diff --git a/docs/API-CONTRACTS.md b/docs/API-CONTRACTS.md
index f23de9e53b..3028a7b69b 100644
--- a/docs/API-CONTRACTS.md
+++ b/docs/API-CONTRACTS.md
@@ -190,6 +190,8 @@ Dynamic multipart endpoints use `MultipartFields` to retain every text value and
## Generation and verification
+`/api/block/migrateLegacyMindmaps` is an authenticated administrator write endpoint with read-only protection and an encrypted-notebook request lease. It requires a document `id` and `notebook`, converts complete legacy `mindmap` lists in one undoable transaction after saving history, and returns `converted` and canonical `blocks` (`id`, `dom`) for the document's mind maps. Repeated requests return the current block content without reconverting lists; incomplete sources remain unchanged. Regression coverage runs with `go test -tags "fts5 sqlcipher" ./model ./api ./apicontract/... -run 'Test(LegacyMindmap|MigrateLegacyMindmaps|APIContractHeadingTransactions|APIContractRouterCoverage|RouteCoverage)' -count=1` and the frontend `listMindmap/migrate.test.ts` and `listMindmap/model.test.ts` suites. These tests use the existing CI discovery paths.
+
Run from `app/`:
```text
diff --git a/docs/API-CONTRACTS.zh-CN.md b/docs/API-CONTRACTS.zh-CN.md
index 7eb2e8819c..1e6fffefc5 100644
--- a/docs/API-CONTRACTS.zh-CN.md
+++ b/docs/API-CONTRACTS.zh-CN.md
@@ -176,6 +176,8 @@ JSON SSE 接口通过 `SSEOptions` 和 `SSEEvent` 声明各事件名称及载荷
## 生成与验证
+`/api/block/migrateLegacyMindmaps` 是要求管理员身份的写入端点,保留只读保护及加密笔记本请求租约。请求必须提供文档 `id` 和 `notebook`;保存历史后,在一次可撤销事务中转换能够完整解析的旧 `mindmap` 列表,返回 `converted` 数量和文档脑图的权威 `blocks`(`id`、`dom`)。重复请求返回当前块内容,不重复转换;不完整的原文保持不变。回归命令为 `go test -tags "fts5 sqlcipher" ./model ./api ./apicontract/... -run 'Test(LegacyMindmap|MigrateLegacyMindmaps|APIContractHeadingTransactions|APIContractRouterCoverage|RouteCoverage)' -count=1`,前端覆盖位于 `listMindmap/migrate.test.ts` 和 `listMindmap/model.test.ts`,均由现有持续集成规则发现。
+
在 `app/` 下运行:
```text
diff --git a/docs/LIST-MINDMAP.md b/docs/LIST-MINDMAP.md
index fe2848ee23..ef925666e7 100644
--- a/docs/LIST-MINDMAP.md
+++ b/docs/LIST-MINDMAP.md
@@ -1,6 +1,10 @@
# 列表脑图
-列表脑图是列表块的另一种视图,入口位于列表块菜单 - 切换为脑图视图。列表项菜单不提供这个入口。已有的 `mindmap` 代码块继续使用原有渲染方式。
+列表脑图是列表块的另一种视图,入口位于列表块菜单 - 切换为脑图视图。列表项菜单不提供这个入口。斜杠菜单和移动端新建脑图直接生成列表脑图,保留原有菜单配置标识。
+
+打开可编辑文档时,编辑器在首次内容渲染前请求内核迁移旧 `mindmap` 代码块。内核在事务串行区读取整份文档,包括折叠和分页未加载的内容;先保存可恢复的文档历史,再通过一次文档事务转换,保留原块 ID、属性、列表层级、正文和任务状态,并为新增子块生成新 ID。转换支持统一撤销和重做;同一编辑器的当前文档只尝试一次,撤销后再次打开文档才会重新迁移。已转换的块不会重复转换,后续同步或导入的旧内容在下次打开时处理。
+
+原文必须完整解析为一个列表块。空内容、列表外正文、多段独立列表或已有脑图配置的异常输入保持原样并显示源码。旧 ECharts 脑图实现已移除;只读、发布、历史和导出页面将旧原文临时解析为列表脑图,派生 DOM 不参与复制和保存。公开的 `Protyle.mindmapRender` 调用入口保持兼容。加密笔记本经请求租约解锁读取,历史保留原始密文,历史写入失败时不执行迁移。
## 交互
diff --git a/kernel/api/contract_block_transaction_test.go b/kernel/api/contract_block_transaction_test.go
index 9e17bacd6a..82488ef5ee 100644
--- a/kernel/api/contract_block_transaction_test.go
+++ b/kernel/api/contract_block_transaction_test.go
@@ -114,6 +114,7 @@ func TestAPIContractHeadingTransactions(t *testing.T) {
engine.POST("/api/block/getHeadingInsertTransaction", getHeadingInsertTransaction)
engine.POST("/api/block/getHeadingFoldTransaction", getHeadingFoldTransaction)
testAPIContractRemainingBlockQueries(t, engine, box.ID, docID, heading.ID)
+ testAPIContractMindmapMigration(t, engine, box.ID, docID)
for _, entry := range []struct {
path, id, scope string
code int
diff --git a/kernel/api/contract_list_mindmap_test.go b/kernel/api/contract_list_mindmap_test.go
new file mode 100644
index 0000000000..356992e253
--- /dev/null
+++ b/kernel/api/contract_list_mindmap_test.go
@@ -0,0 +1,68 @@
+package api
+
+import (
+ "encoding/json"
+ "net/http/httptest"
+ "strings"
+ "testing"
+
+ "github.com/gin-gonic/gin"
+ "github.com/siyuan-note/siyuan/kernel/apicontract"
+ "github.com/siyuan-note/siyuan/kernel/model"
+ "github.com/siyuan-note/siyuan/kernel/util"
+)
+
+func testAPIContractMindmapMigration(t *testing.T, engine *gin.Engine, boxID, docID string) {
+ const endpoint = "/api/block/migrateLegacyMindmaps"
+ engine.POST(endpoint, func(c *gin.Context) {
+ role := model.RoleAdministrator
+ if c.GetHeader("X-Test-Reader") == "1" {
+ role = model.RoleReader
+ }
+ c.Set(model.RoleContextKey, role)
+ }, model.CheckAdminRole, model.CheckReadonly, migrateLegacyMindmaps)
+ const id = "20260920000000-oldcode"
+ dom := util.NewLute().Md2BlockDOM("```mindmap\n- Root\n - Child\n```\n{: id=\""+id+"\"}", false)
+ if _, err := model.PerformBlockOperation(&model.Operation{Action: "appendInsert", ParentID: docID, Data: dom}); err != nil {
+ t.Fatal(err)
+ }
+ type response struct {
+ Code int `json:"code"`
+ Data apicontract.MigrateLegacyMindmapsData `json:"data"`
+ }
+ post := func(body string) response {
+ t.Helper()
+ recorder := httptest.NewRecorder()
+ engine.ServeHTTP(recorder, httptest.NewRequest("POST", endpoint, strings.NewReader(body)))
+ requireAPIContract(t, "POST", endpoint, recorder)
+ var result response
+ if err := json.Unmarshal(recorder.Body.Bytes(), &result); err != nil {
+ t.Fatal(err)
+ }
+ return result
+ }
+ for _, body := range []string{"", "null", `{}`, `{"id":42,"notebook":""}`, `{"id":"missing","notebook":""}`} {
+ if result := post(body); result.Code == 0 {
+ t.Fatalf("invalid migration request accepted: %s", body)
+ }
+ }
+ body, _ := json.Marshal(map[string]string{"id": docID, "notebook": boxID})
+ reader := httptest.NewRequest("POST", endpoint, strings.NewReader(string(body)))
+ reader.Header.Set("X-Test-Reader", "1")
+ recorder := httptest.NewRecorder()
+ engine.ServeHTTP(recorder, reader)
+ if recorder.Code != 403 {
+ t.Fatalf("reader migration was not denied: %d", recorder.Code)
+ }
+ if !strings.Contains(model.GetBlockDOM(id), `data-subtype="mindmap"`) {
+ t.Fatal("reader request modified source")
+ }
+ result := post(string(body))
+ if result.Code != 0 || result.Data.Converted != 1 || len(result.Data.Blocks) != 1 || result.Data.Blocks[0].ID != id ||
+ !strings.Contains(result.Data.Blocks[0].DOM, `custom-sy-list-mindmap="1"`) {
+ t.Fatalf("unexpected migration response: %+v", result)
+ }
+ if result = post(string(body)); result.Code != 0 || result.Data.Converted != 0 || len(result.Data.Blocks) != 1 {
+ t.Fatalf("repeat migration did not return current content: %+v", result)
+ }
+}
diff --git a/kernel/api/list_mindmap.go b/kernel/api/list_mindmap.go
new file mode 100644
index 0000000000..f955543b28
--- /dev/null
+++ b/kernel/api/list_mindmap.go
@@ -0,0 +1,25 @@
+package api
+
+import (
+ "github.com/gin-gonic/gin"
+ "github.com/siyuan-note/siyuan/kernel/apicontract"
+ "github.com/siyuan-note/siyuan/kernel/model"
+)
+
+var migrateLegacyMindmaps = contractHandler(apicontract.MigrateLegacyMindmaps, func(c *gin.Context, request apicontract.MigrateLegacyMindmapsRequest) apicontract.Response[apicontract.MigrateLegacyMindmapsData] {
+ if _, err := holdContractBlockRequest(c, request.Notebook, request.ID, nil, false); err != nil {
+ return apicontract.Failure[apicontract.MigrateLegacyMindmapsData](-1, err.Error())
+ }
+ tx, visible, err := model.MigrateLegacyMindmaps(request.ID)
+ if tx != nil && len(tx.DoOperations) > 0 {
+ broadcastTransactions([]*model.Transaction{tx})
+ }
+ if err != nil {
+ return apicontract.Failure[apicontract.MigrateLegacyMindmapsData](-1, err.Error())
+ }
+ data := apicontract.MigrateLegacyMindmapsData{Converted: len(tx.DoOperations), Blocks: []apicontract.BlockDOMData{}}
+ for id, dom := range visible {
+ data.Blocks = append(data.Blocks, apicontract.BlockDOMData{ID: id, DOM: dom})
+ }
+ return apicontract.Success(data)
+})
diff --git a/kernel/api/router.go b/kernel/api/router.go
index fa60fa8cdf..59e9a2d042 100644
--- a/kernel/api/router.go
+++ b/kernel/api/router.go
@@ -296,6 +296,7 @@ func ServeAPI(ginServer *gin.Engine) {
ginServer.Handle("POST", "/api/block/appendDailyNoteBlock", model.CheckAuth, model.CheckAdminRole, model.CheckReadonly, appendDailyNoteBlock)
ginServer.Handle("POST", "/api/block/prependDailyNoteBlock", model.CheckAuth, model.CheckAdminRole, model.CheckReadonly, prependDailyNoteBlock)
ginServer.Handle("POST", "/api/block/updateBlock", model.CheckAuth, model.CheckAdminRole, model.CheckReadonly, updateBlock)
+ ginServer.Handle("POST", "/api/block/migrateLegacyMindmaps", model.CheckAuth, model.CheckAdminRole, model.CheckReadonly, migrateLegacyMindmaps)
ginServer.Handle("POST", "/api/block/batchUpdateBlock", model.CheckAuth, model.CheckAdminRole, model.CheckReadonly, batchUpdateBlock)
ginServer.Handle("POST", "/api/block/deleteBlock", model.CheckAuth, model.CheckAdminRole, model.CheckReadonly, deleteBlock)
ginServer.Handle("POST", "/api/block/moveBlock", model.CheckAuth, model.CheckAdminRole, model.CheckReadonly, moveBlock)
diff --git a/kernel/apicontract/contracts.go b/kernel/apicontract/contracts.go
index 311ce586a3..c75ae9c38d 100644
--- a/kernel/apicontract/contracts.go
+++ b/kernel/apicontract/contracts.go
@@ -381,6 +381,8 @@ var BatchInsertBlock = define[BatchInsertBlockRequest, []*BlockTransaction]("bat
var UpdateBlock = define[UpdateBlockRequest, []*BlockTransaction]("updateBlock", "/api/block/updateBlock", JSONBody, ResponseOptions{}, "POST")
+var MigrateLegacyMindmaps = define[MigrateLegacyMindmapsRequest, MigrateLegacyMindmapsData]("migrateLegacyMindmaps", "/api/block/migrateLegacyMindmaps", JSONBody, ResponseOptions{}, "POST")
+
var BatchUpdateBlock = define[BatchUpdateBlockRequest, []*BlockTransaction]("batchUpdateBlock", "/api/block/batchUpdateBlock", JSONBody, ResponseOptions{}, "POST")
var DeleteBlock = define[DeleteBlockRequest, []*BlockTransaction]("deleteBlock", "/api/block/deleteBlock", JSONBody, ResponseOptions{}, "POST")
diff --git a/kernel/apicontract/list_mindmap.go b/kernel/apicontract/list_mindmap.go
new file mode 100644
index 0000000000..852276cce5
--- /dev/null
+++ b/kernel/apicontract/list_mindmap.go
@@ -0,0 +1,11 @@
+package apicontract
+
+type MigrateLegacyMindmapsRequest struct {
+ ID string `json:"id"`
+ Notebook string `json:"notebook"`
+}
+
+type MigrateLegacyMindmapsData struct {
+ Converted int `json:"converted"`
+ Blocks []BlockDOMData `json:"blocks"`
+}
diff --git a/kernel/apicontract/schema.json b/kernel/apicontract/schema.json
index db41ec5e6b..595252fc3c 100644
--- a/kernel/apicontract/schema.json
+++ b/kernel/apicontract/schema.json
@@ -28861,6 +28861,48 @@
],
"additionalProperties": false
},
+ "MigrateLegacyMindmapsData": {
+ "type": "object",
+ "properties": {
+ "blocks": {
+ "anyOf": [
+ {
+ "type": "array",
+ "items": {
+ "$ref": "#/$defs/BlockDOMData"
+ }
+ },
+ {
+ "type": "null"
+ }
+ ]
+ },
+ "converted": {
+ "type": "integer"
+ }
+ },
+ "required": [
+ "blocks",
+ "converted"
+ ],
+ "additionalProperties": false
+ },
+ "MigrateLegacyMindmapsRequestInput": {
+ "type": "object",
+ "properties": {
+ "id": {
+ "type": "string"
+ },
+ "notebook": {
+ "type": "string"
+ }
+ },
+ "required": [
+ "id",
+ "notebook"
+ ],
+ "additionalProperties": false
+ },
"MoveBlockRequestInput": {
"type": "object",
"properties": {
@@ -125067,6 +125109,81 @@
]
}
},
+ {
+ "method": "POST",
+ "path": "/api/block/migrateLegacyMindmaps",
+ "handler": "migrateLegacyMindmaps",
+ "body": "json",
+ "request": {
+ "$ref": "#/$defs/MigrateLegacyMindmapsRequestInput"
+ },
+ "response": {
+ "anyOf": [
+ {
+ "type": "object",
+ "properties": {
+ "code": {
+ "type": "integer",
+ "enum": [
+ 0
+ ]
+ },
+ "data": {
+ "$ref": "#/$defs/MigrateLegacyMindmapsData"
+ },
+ "msg": {
+ "type": "string"
+ }
+ },
+ "required": [
+ "code",
+ "msg",
+ "data"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "type": "object",
+ "properties": {
+ "code": {
+ "type": "integer",
+ "enum": [
+ -1
+ ]
+ },
+ "data": {
+ "anyOf": [
+ {
+ "type": "object",
+ "properties": {
+ "closeTimeout": {
+ "type": "number"
+ }
+ },
+ "required": [
+ "closeTimeout"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "type": "null"
+ }
+ ]
+ },
+ "msg": {
+ "type": "string"
+ }
+ },
+ "required": [
+ "code",
+ "msg",
+ "data"
+ ],
+ "additionalProperties": true
+ }
+ ]
+ }
+ },
{
"method": "POST",
"path": "/api/block/moveBlock",
diff --git a/kernel/model/list_mindmap_migration.go b/kernel/model/list_mindmap_migration.go
new file mode 100644
index 0000000000..605d254551
--- /dev/null
+++ b/kernel/model/list_mindmap_migration.go
@@ -0,0 +1,144 @@
+package model
+
+import (
+ "errors"
+ "os"
+ "path/filepath"
+ "strings"
+
+ "github.com/88250/gulu"
+ "github.com/88250/lute"
+ "github.com/88250/lute/ast"
+ "github.com/88250/lute/parse"
+ "github.com/siyuan-note/filelock"
+ "github.com/siyuan-note/siyuan/kernel/treenode"
+ "github.com/siyuan-note/siyuan/kernel/util"
+)
+
+const listMindmapViewAttr = "custom-sy-list-mindmap"
+
+// legacyMindmapList 从完整 Markdown 原文生成列表,不能仅提取渲染树中的节点文字。
+func legacyMindmapList(node *ast.Node, engine *lute.Lute) *ast.Node {
+ if !isLegacyMindmap(node) {
+ return nil
+ }
+ code := node.ChildByType(ast.NodeCodeBlockCode)
+ if code == nil || strings.TrimSpace(string(code.Tokens)) == "" || node.IALAttr(listMindmapMetadataAttr) != "" {
+ return nil
+ }
+ _, parsed := engine.Md2BlockDOMTree(string(code.Tokens), false)
+ blocks := blockChildrenOf(parsed.Root)
+ if len(blocks) != 1 || blocks[0].Type != ast.NodeList {
+ return nil
+ }
+ list := blocks[0]
+ if list.IALAttr(listMindmapMetadataAttr) != "" {
+ return nil
+ }
+ // 原文中的显式块 ID 不能占用工作空间内已有块的身份。
+ ast.Walk(list, func(n *ast.Node, entering bool) ast.WalkStatus {
+ if entering && n.IsBlock() && n.Type != ast.NodeKramdownBlockIAL {
+ n.ID = ast.NewNodeID()
+ n.SetIALAttr("id", n.ID)
+ n.SetIALAttr("updated", n.ID[:14])
+ }
+ return ast.WalkContinue
+ })
+ for _, attr := range node.KramdownIAL {
+ list.SetIALAttr(attr[0], node.IALAttr(attr[0]))
+ }
+ list.ID = node.ID
+ list.SetIALAttr("id", node.ID)
+ list.SetIALAttr(listMindmapViewAttr, "1")
+ if treenode.ValidateBlockReplacement(node, list) != nil {
+ return nil
+ }
+ return list
+}
+
+func isLegacyMindmap(node *ast.Node) bool {
+ if node.Type != ast.NodeCodeBlock {
+ return false
+ }
+ info := node.ChildByType(ast.NodeCodeBlockFenceInfoMarker)
+ return info != nil && string(info.CodeBlockInfo) == "mindmap"
+}
+
+// MigrateLegacyMindmaps 在事务串行区内读取完整文档,迁移后返回调用方当前显示块的权威内容。
+func MigrateLegacyMindmaps(id string) (tx *Transaction, visible map[string]string, err error) {
+ flushLock.Lock()
+ isFlushing.Store(true)
+ defer func() {
+ isFlushing.Store(false)
+ flushLock.Unlock()
+ }()
+ for _, queued := range takeQueuedTransactions() {
+ flushTx(queued)
+ }
+ tree, err := LoadTreeByBlockID(id)
+ if err != nil {
+ return nil, nil, err
+ }
+ if tree.ID != id || tree.Root.IALAttr("custom-sy-readonly") == "true" {
+ return nil, nil, errors.New("mind map migration requires an editable document")
+ }
+ engine := util.NewLute()
+ tx = &Transaction{fromAPI: true}
+ ast.Walk(tree.Root, func(n *ast.Node, entering bool) ast.WalkStatus {
+ if !entering {
+ return ast.WalkContinue
+ }
+ if n.IALAttr("custom-sy-readonly") == "true" {
+ return ast.WalkSkipChildren
+ }
+ if list := legacyMindmapList(n, engine); list != nil {
+ tx.DoOperations = append(tx.DoOperations, &Operation{Action: "update", ID: n.ID, Data: engine.RenderNodeBlockDOM(list)})
+ tx.UndoOperations = append(tx.UndoOperations, &Operation{Action: "update", ID: n.ID, Data: engine.RenderNodeBlockDOM(n)})
+ }
+ return ast.WalkContinue
+ })
+ if len(tx.DoOperations) > 0 {
+ if err = saveMindmapMigrationHistory(tree); err != nil {
+ return nil, nil, err
+ }
+ if err = performTxSyncLocked(tx); err != nil {
+ return nil, nil, err
+ }
+ tree, err = LoadTreeByBlockID(id)
+ if err != nil {
+ return tx, nil, err
+ }
+ }
+ visible = map[string]string{}
+ ast.Walk(tree.Root, func(node *ast.Node, entering bool) ast.WalkStatus {
+ if entering && (node.Type == ast.NodeList && node.IALAttr(listMindmapViewAttr) == "1" ||
+ isLegacyMindmap(node)) {
+ visible[node.ID] = engine.RenderNodeBlockDOM(node)
+ }
+ return ast.WalkContinue
+ })
+ return
+}
+
+// 迁移前保存已落盘原文;使用格式化历史,避免被同一秒的定时更新历史覆盖。
+// 加密文档直接保存密文,任何历史写入错误都阻止本次迁移。
+func saveMindmapMigrationHistory(tree *parse.Tree) error {
+ historyDir, err := getHistoryDir(HistoryOpFormat)
+ if err != nil {
+ return err
+ }
+ source := filepath.Join(util.DataDir, tree.Box, tree.Path)
+ data, err := filelock.ReadFile(source)
+ if err != nil {
+ return err
+ }
+ target := filepath.Join(historyDir, tree.Box, tree.Path)
+ if err = os.MkdirAll(filepath.Dir(target), 0755); err != nil {
+ return err
+ }
+ if err = gulu.File.WriteFileSafer(target, data, 0644); err != nil {
+ return err
+ }
+ indexHistoryDir(filepath.Base(historyDir), util.NewLute())
+ return nil
+}
diff --git a/kernel/model/list_mindmap_migration_crypto_test.go b/kernel/model/list_mindmap_migration_crypto_test.go
new file mode 100644
index 0000000000..9015576707
--- /dev/null
+++ b/kernel/model/list_mindmap_migration_crypto_test.go
@@ -0,0 +1,108 @@
+//go:build fts5 && (sqlcipher || libsqlcipher)
+
+package model
+
+import (
+ "bytes"
+ "context"
+ "os"
+ "os/exec"
+ "path/filepath"
+ "strings"
+ "testing"
+ "time"
+
+ "github.com/88250/lute/ast"
+ "github.com/siyuan-note/siyuan/kernel/cache"
+ "github.com/siyuan-note/siyuan/kernel/filesys"
+ "github.com/siyuan-note/siyuan/kernel/treenode"
+ "github.com/siyuan-note/siyuan/kernel/util"
+)
+
+func TestMigrateLegacyMindmapsEncrypted(t *testing.T) {
+ if os.Getenv("SIYUAN_TEST_MINDMAP_CRYPTO") != "1" {
+ ctx, cancel := context.WithTimeout(context.Background(), 45*time.Second)
+ defer cancel()
+ command := exec.CommandContext(ctx, os.Args[0], "-test.run=^TestMigrateLegacyMindmapsEncrypted$")
+ command.Env = append(os.Environ(), "SIYUAN_TEST_MINDMAP_CRYPTO=1")
+ if output, err := command.CombinedOutput(); err != nil {
+ t.Fatalf("encrypted migration subprocess failed: %v\n%s", err, output)
+ }
+ return
+ }
+ fixture := setupStructureTransactionTest(t)
+ setupFoldTransactionDatabase(t, fixture)
+ util.WorkspaceDir = filepath.Dir(util.HistoryDir)
+ const password = "mindmap-migration-test"
+ if err := EnableEncryptedNotebook(password); err != nil {
+ t.Fatal(err)
+ }
+ boxID, err := CreateEncryptedBox("Mind map migration", password)
+ if err != nil {
+ t.Fatal(err)
+ }
+ docID := ast.NewNodeID()
+ tree := treenode.NewTree(boxID, "/"+docID+".sy", "/Mind map", "Mind map")
+ engine := util.NewLute()
+ _, source := engine.Md2BlockDOMTree("```mindmap\n- Confidential root\n - [/] Child\n```", false)
+ code := firstContentBlock(source.Root)
+ code.Unlink()
+ tree.Root.AppendChild(code)
+ if _, err = filesys.WriteTree(tree); err != nil {
+ t.Fatal(err)
+ }
+ treenode.UpsertBlockTree(tree)
+ path := filepath.Join(util.DataDir, boxID, tree.Path)
+ before, err := os.ReadFile(path)
+ if err != nil || !util.IsCiphertext(before) {
+ t.Fatalf("source is not encrypted: %v", err)
+ }
+ tx, _, err := MigrateLegacyMindmaps(docID)
+ if err != nil || len(tx.DoOperations) != 1 {
+ t.Fatalf("encrypted migration failed: %+v, %v", tx, err)
+ }
+ after, err := os.ReadFile(path)
+ if err != nil || !util.IsCiphertext(after) || bytes.Equal(before, after) || bytes.Contains(after, []byte("Confidential")) {
+ t.Fatalf("migration did not preserve encryption: %v", err)
+ }
+ histories, err := filepath.Glob(filepath.Join(util.HistoryDir, "*-format", boxID, docID+".sy"))
+ if err != nil || len(histories) != 1 {
+ t.Fatalf("missing encrypted history: %v, %v", histories, err)
+ }
+ history, err := os.ReadFile(histories[0])
+ if err != nil || !bytes.Equal(before, history) {
+ t.Fatalf("encrypted recovery data changed: %v", err)
+ }
+ relative, err := filepath.Rel(util.WorkspaceDir, histories[0])
+ if err != nil {
+ t.Fatal(err)
+ }
+ _, _, content, _, err := GetDocHistoryContent(relative, "", false)
+ if err != nil || !strings.Contains(content, `data-subtype="mindmap"`) {
+ t.Fatalf("encrypted history cannot recover the source: %v", err)
+ }
+ for _, operations := range [][]*Operation{tx.UndoOperations, tx.DoOperations} {
+ replay := &Transaction{DoOperations: operations}
+ replay.MarkReplay()
+ if err = PerformTxSync(replay); err != nil {
+ t.Fatal(err)
+ }
+ data, readErr := os.ReadFile(path)
+ if readErr != nil || !util.IsCiphertext(data) {
+ t.Fatalf("undo or redo wrote plaintext: %v", readErr)
+ }
+ }
+ corrupt, _ := os.ReadFile(path)
+ corrupt[len(corrupt)-1] ^= 1
+ if err = os.WriteFile(path, corrupt, 0644); err != nil {
+ t.Fatal(err)
+ }
+ cache.RemoveTreeData(docID)
+ if _, _, err = MigrateLegacyMindmaps(docID); err == nil {
+ t.Fatal("corrupt ciphertext was accepted")
+ }
+ retained, _ := os.ReadFile(path)
+ if !bytes.Equal(retained, corrupt) {
+ t.Fatal("failed authentication overwrote the original data")
+ }
+}
diff --git a/kernel/model/list_mindmap_migration_fts5_test.go b/kernel/model/list_mindmap_migration_fts5_test.go
new file mode 100644
index 0000000000..7bb1278393
--- /dev/null
+++ b/kernel/model/list_mindmap_migration_fts5_test.go
@@ -0,0 +1,128 @@
+//go:build fts5
+
+package model
+
+import (
+ "bytes"
+ "os"
+ "path/filepath"
+ "strings"
+ "testing"
+
+ "github.com/88250/lute/ast"
+ "github.com/siyuan-note/siyuan/kernel/cache"
+ "github.com/siyuan-note/siyuan/kernel/filesys"
+ "github.com/siyuan-note/siyuan/kernel/treenode"
+ "github.com/siyuan-note/siyuan/kernel/util"
+)
+
+func TestMigrateLegacyMindmapsPersistsAndReplays(t *testing.T) {
+ fixture := setupStructureTransactionTest(t)
+ setupFoldTransactionDatabase(t, fixture)
+ originalHistory := util.HistoryDir
+ util.HistoryDir = t.TempDir()
+ t.Cleanup(func() { util.HistoryDir = originalHistory })
+ const codeID = "20260920000000-oldcode"
+ dom := util.NewLute().Md2BlockDOM("```mindmap\n- Root\n - [X] Child\n```\n{: id=\""+codeID+"\" name=\"keep\"}", false)
+ if _, err := PerformBlockOperation(&Operation{Action: "appendInsert", ParentID: fixture.sourceID, Data: dom}); err != nil {
+ t.Fatal(err)
+ }
+ sourcePath := filepath.Join(util.DataDir, fixture.box.ID, fixture.sourceID+".sy")
+ before, err := os.ReadFile(sourcePath)
+ if err != nil {
+ t.Fatal(err)
+ }
+ tx, visible, err := MigrateLegacyMindmaps(fixture.sourceID)
+ if err != nil || len(tx.DoOperations) != 1 || len(tx.UndoOperations) != 1 || visible[codeID] == "" {
+ t.Fatalf("migration failed: %+v, %v", tx, err)
+ }
+ check := func(typ ast.NodeType) {
+ t.Helper()
+ cache.RemoveTreeData(fixture.sourceID)
+ tree, loadErr := LoadTreeByBlockID(fixture.sourceID)
+ if loadErr != nil {
+ t.Fatal(loadErr)
+ }
+ node := treenode.GetNodeInTree(tree, codeID)
+ if node == nil || node.Type != typ || node.IALAttr("name") != "keep" {
+ t.Fatalf("unexpected persisted node: %+v", node)
+ }
+ }
+ check(ast.NodeList)
+ entry := GlobalUndoLog.Peek(fixture.sourceID)
+ if entry == nil || len(entry.UndoOperationsForReplay()) != 1 || entry.UndoOperationsForReplay()[0].ID != codeID {
+ t.Fatal("migration did not enter the document undo stack")
+ }
+ t.Cleanup(func() { GlobalUndoLog.Clear(fixture.sourceID) })
+ histories, err := filepath.Glob(filepath.Join(util.HistoryDir, "*-format", fixture.box.ID, fixture.sourceID+".sy"))
+ if err != nil || len(histories) != 1 {
+ t.Fatalf("missing history: %v, %v", histories, err)
+ }
+ history, err := os.ReadFile(histories[0])
+ if err != nil || !bytes.Equal(before, history) {
+ t.Fatalf("history did not preserve the original file: %v", err)
+ }
+ again, _, err := MigrateLegacyMindmaps(fixture.sourceID)
+ if err != nil || len(again.DoOperations) != 0 {
+ t.Fatalf("migration is not idempotent: %+v, %v", again, err)
+ }
+ for i, operations := range [][]*Operation{tx.UndoOperations, tx.DoOperations} {
+ replay := &Transaction{DoOperations: operations}
+ replay.MarkReplay()
+ if err = PerformTxSync(replay); err != nil {
+ t.Fatal(err)
+ }
+ if i == 0 {
+ check(ast.NodeCodeBlock)
+ } else {
+ check(ast.NodeList)
+ }
+ }
+}
+
+func TestMigrateLegacyMindmapsHistoryFailureAndQueuedEdits(t *testing.T) {
+ fixture := setupStructureTransactionTest(t)
+ setupFoldTransactionDatabase(t, fixture)
+ const codeID = "20260920000000-oldcode"
+ engine := util.NewLute()
+ dom := engine.Md2BlockDOM("- Parent\n\n ```mindmap\n - Original\n ```\n {: id=\""+codeID+"\"}\n", false)
+ if _, err := PerformBlockOperation(&Operation{Action: "appendInsert", ParentID: fixture.sourceID, Data: dom}); err != nil {
+ t.Fatal(err)
+ }
+ tree, err := LoadTreeByBlockID(fixture.sourceID)
+ if err != nil {
+ t.Fatal(err)
+ }
+ code := treenode.GetNodeInTree(tree, codeID)
+ if code == nil {
+ t.Fatal("nested fixture code was not created")
+ }
+ code.Parent.SetIALAttr("fold", "1")
+ if _, err = filesys.WriteTree(tree); err != nil {
+ t.Fatal(err)
+ }
+ sourcePath := filepath.Join(util.DataDir, fixture.box.ID, tree.Path)
+ before, _ := os.ReadFile(sourcePath)
+ originalHistory := util.HistoryDir
+ util.HistoryDir = filepath.Join(t.TempDir(), "unwritable-history")
+ if err = os.WriteFile(util.HistoryDir, []byte("file"), 0644); err != nil {
+ t.Fatal(err)
+ }
+ _, _, err = MigrateLegacyMindmaps(fixture.sourceID)
+ util.HistoryDir = originalHistory
+ if err == nil {
+ t.Fatal("migration continued without a recoverable history")
+ }
+ after, _ := os.ReadFile(sourcePath)
+ if !bytes.Equal(before, after) {
+ t.Fatal("failed history write modified the document")
+ }
+ newDOM := engine.Md2BlockDOM("```mindmap\n- Latest edit\n```\n{: id=\""+codeID+"\"}", false)
+ queued := []*Transaction{{DoOperations: []*Operation{{Action: "update", ID: codeID, Data: newDOM}}}}
+ PerformTransactions(&queued)
+ tx, visible, err := MigrateLegacyMindmaps(fixture.sourceID)
+ if err != nil || len(tx.DoOperations) != 1 || !strings.Contains(visible[codeID], "Latest edit") {
+ t.Fatalf("migration missed folded content or queued edits: %v", err)
+ }
+ t.Cleanup(func() { GlobalUndoLog.Clear(fixture.sourceID) })
+}
diff --git a/kernel/model/list_mindmap_migration_test.go b/kernel/model/list_mindmap_migration_test.go
new file mode 100644
index 0000000000..b4dca4a6b9
--- /dev/null
+++ b/kernel/model/list_mindmap_migration_test.go
@@ -0,0 +1,73 @@
+package model
+
+import (
+ "strings"
+ "testing"
+
+ "github.com/88250/lute/ast"
+ "github.com/siyuan-note/siyuan/kernel/util"
+)
+
+func TestLegacyMindmapList(t *testing.T) {
+ engine := util.NewLute()
+ for _, source := range []string{
+ "- Root\n - Child\n - Grandchild\n",
+ "- First\n- Second\n",
+ "3. First\n4. Second\n",
+ "- [ ] Todo\n- [X] Done\n- [/] Progress\n",
+ "- **Bold** ~~deleted~~ [link](https://example.com) `code`\n\n Another paragraph\n\n ![image](assets/image.png)\n\n - Child\n",
+ "- Text\n {: id=\"20260920000000-content\" custom-test=\"keep\"}\n",
+ } {
+ t.Run(source, func(t *testing.T) {
+ _, parsed := engine.Md2BlockDOMTree("```mindmap\n"+source+"```", false)
+ code := firstContentBlock(parsed.Root)
+ code.ID = "20260920000000-oldcode"
+ code.SetIALAttr("id", "20260920000000-oldcode")
+ code.SetIALAttr("name", "Name")
+ code.SetIALAttr("alias", "Alias")
+ code.SetIALAttr("custom-test", "preserved")
+ before := engine.RenderNodeBlockDOM(code)
+ list := legacyMindmapList(code, engine)
+ if list == nil || list.ID != code.ID || list.Type != ast.NodeList || list.IALAttr(listMindmapViewAttr) != "1" {
+ t.Fatalf("conversion failed: %+v", list)
+ }
+ if list.IALAttr("name") != "Name" || list.IALAttr("alias") != "Alias" || list.IALAttr("custom-test") != "preserved" {
+ t.Fatal("block attributes were lost")
+ }
+ if engine.RenderNodeBlockDOM(code) != before {
+ t.Fatal("source was mutated while preparing conversion")
+ }
+ ids := map[string]bool{code.ID: true}
+ ast.Walk(list, func(node *ast.Node, entering bool) ast.WalkStatus {
+ if entering && node.IsBlock() && node != list && node.Type != ast.NodeKramdownBlockIAL {
+ if !ast.IsNodeIDPattern(node.ID) || ids[node.ID] || node.ID == "20260920000000-content" {
+ t.Fatalf("descendant did not receive a fresh ID: %s", node.ID)
+ }
+ ids[node.ID] = true
+ }
+ return ast.WalkContinue
+ })
+ dom := engine.RenderNodeBlockDOM(list)
+ for _, expected := range []string{"assets/image.png", "https://example.com", "Another paragraph", "Grandchild"} {
+ if strings.Contains(source, expected) && !strings.Contains(dom, expected) {
+ t.Fatalf("content disappeared: %s", expected)
+ }
+ }
+ if strings.Contains(source, "[X]") && !strings.Contains(dom, `data-task="X"`) {
+ t.Fatalf("task state changed: %s", dom)
+ }
+ })
+ }
+}
+
+func TestLegacyMindmapListRejectsPartialConversion(t *testing.T) {
+ engine := util.NewLute()
+ for _, source := range []string{"", "Plain text\n", "- List\n\nOutside text\n", "- First\n\n1. Second\n"} {
+ _, parsed := engine.Md2BlockDOMTree("```mindmap\n"+source+"```", false)
+ node := firstContentBlock(parsed.Root)
+ before := engine.RenderNodeBlockDOM(node)
+ if legacyMindmapList(node, engine) != nil || before != engine.RenderNodeBlockDOM(node) {
+ t.Fatalf("unsupported source was partially converted: %q", source)
+ }
+ }
+}