Close Задача №0 (SPEC §11) with the spec-sanctioned option (b): compare a canonicalized ProseMirror form instead of raw bytes. - canonicalize.ts: canonicalizeContent/docsCanonicallyEqual — strip node attrs.id, drop null/undefined attrs, and drop attrs equal to their type's known non-null schema default (KNOWN_DEFAULTS: link target/rel, comment.resolved, orderedList.start, diagram/media align) so "absent" ≡ "default"; comment anchors + meaningful attrs kept - roundtrip.ts: assert markdown byte-stability AND canonical stability; add --corpus mode and mutually-exclusive-flag warning - synthetic corpus (headings, marks, lists, table, callout, code w/ trailing \n, diagrams, textStyle/mention) + canonicalize/corpus tests (558 green) - known converter asymmetries (block image after paragraph; embed width/height coercion) converge to a fixpoint after one export->import pass -> handled by normalize-on-write at vault-write time; isolated under it.fails - SPEC §11: record the resolution and normalize-on-write strategy
114 lines
2.7 KiB
JSON
114 lines
2.7 KiB
JSON
{
|
|
"type": "doc",
|
|
"content": [
|
|
{
|
|
"type": "bulletList",
|
|
"content": [
|
|
{
|
|
"type": "listItem",
|
|
"content": [
|
|
{
|
|
"type": "paragraph",
|
|
"content": [{ "type": "text", "text": "First bullet" }]
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"type": "listItem",
|
|
"content": [
|
|
{
|
|
"type": "paragraph",
|
|
"content": [{ "type": "text", "text": "Second bullet with a nested list" }]
|
|
},
|
|
{
|
|
"type": "bulletList",
|
|
"content": [
|
|
{
|
|
"type": "listItem",
|
|
"content": [
|
|
{
|
|
"type": "paragraph",
|
|
"content": [{ "type": "text", "text": "Nested bullet A" }]
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"type": "listItem",
|
|
"content": [
|
|
{
|
|
"type": "paragraph",
|
|
"content": [{ "type": "text", "text": "Nested bullet B" }]
|
|
}
|
|
]
|
|
}
|
|
]
|
|
}
|
|
]
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"type": "orderedList",
|
|
"content": [
|
|
{
|
|
"type": "listItem",
|
|
"content": [
|
|
{
|
|
"type": "paragraph",
|
|
"content": [{ "type": "text", "text": "First ordered item" }]
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"type": "listItem",
|
|
"content": [
|
|
{
|
|
"type": "paragraph",
|
|
"content": [{ "type": "text", "text": "Second ordered item" }]
|
|
},
|
|
{
|
|
"type": "orderedList",
|
|
"content": [
|
|
{
|
|
"type": "listItem",
|
|
"content": [
|
|
{
|
|
"type": "paragraph",
|
|
"content": [{ "type": "text", "text": "Nested ordered one" }]
|
|
}
|
|
]
|
|
}
|
|
]
|
|
}
|
|
]
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"type": "taskList",
|
|
"content": [
|
|
{
|
|
"type": "taskItem",
|
|
"attrs": { "checked": true },
|
|
"content": [
|
|
{
|
|
"type": "paragraph",
|
|
"content": [{ "type": "text", "text": "Done task" }]
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"type": "taskItem",
|
|
"attrs": { "checked": false },
|
|
"content": [
|
|
{
|
|
"type": "paragraph",
|
|
"content": [{ "type": "text", "text": "Pending task" }]
|
|
}
|
|
]
|
|
}
|
|
]
|
|
}
|
|
]
|
|
}
|