10f - plainMarkdownToAdf mints task localIds as UUID v4s hashed from the markdown and position #148

Merged
lilleman merged 5 commits from 10f into main 2026-09-29 23:38:52 +02:00
2 changed files with 8 additions and 9 deletions
Showing only changes of commit 1f7d11ea3e - Show all commits
+2 -2
View File
@@ -165,8 +165,8 @@ read replaces mentions, attachments and macros with text.
## The errors
An ADF node type this version does not know is not an error: it is carried opaquely and restores
unchanged ([`docs/decisions.md`](https://gitea.larvit.se/larvit/adf-codec/src/branch/main/docs/decisions.md#unknown-nodes-ride-the-carry)).
An ADF node type this version does not know is not an error: the lossless pair carries it opaquely
and restores it unchanged ([`docs/decisions.md`](https://gitea.larvit.se/larvit/adf-codec/src/branch/main/docs/decisions.md#unknown-nodes-ride-the-carry)).
`ConvertError` is `{ code, message, path, position? }`. `code` is the exported `ConvertErrorCode`,
stable across minors and safe to `switch` on exhaustively with no `default`; `message` is free text
+6 -7
View File
@@ -50,8 +50,8 @@ An unknown ADF node is carried opaquely — raw JSON rides a dedicated syntax in
restores to a deep-equal node. The round-trip holds for documents newer than the library. So does
a known node no section spells where it stands: a markdown serializer spells a node by type without
checking its position, and refusing loses a document ADF itself keeps in an `unsupportedBlock`.
Where a container's own spelling cannot hold the child it has — a `bulletList` outside `listItem`,
a `codeBlock` outside text — the error result names that instead.
Where a container's own spelling cannot hold the child it has — a `bulletList` holding other than
`listItem`, a `codeBlock` other than text — the error result names that instead.
## Foreign HTML sorts three ways
@@ -131,11 +131,10 @@ accepted.
node with no `localId`.
`plainMarkdownToAdf` gives each `taskList`, `taskItem` and `blockTaskItem` lacking one a `localId`
in the editor's UUID v4 shape, hashed (cyrb128) from the whole markdown and the node's position in
document order, skipping any id the document holds. A site rejecting a missing `localId` takes the
document, the same markdown reads to the same ids every run, and different markdown to ids no other
document shares. The same markdown pasted twice into one document repeats its ids: determinism
wins over that case. A node the carry restores stays deep-equal (§Unknown nodes ride the carry): its
in the editor's UUID v4 shape, hashed from the whole markdown and the node's order among those it
mints, skipping any id the document holds: the same markdown reads to the same ids every run,
different markdown to different ids. The same markdown pasted twice into one document repeats its
ids: determinism wins over that case. A node the carry restores stays deep-equal (§Unknown nodes ride the carry): its
ids are only skipped.
## A callout title keeps its link targets