10f - review: the position id and carry entries and the errors intro stated truly
CI / gate (push) Successful in 42s
CI / publish (push) Successful in 6s

This commit was merged in pull request #148.
This commit is contained in:
2026-09-29 23:37:39 +02:00
parent 050e52296a
commit 1f7d11ea3e
2 changed files with 8 additions and 9 deletions
+2 -2
View File
@@ -165,8 +165,8 @@ read replaces mentions, attachments and macros with text.
## The errors ## The errors
An ADF node type this version does not know is not an error: it is carried opaquely and restores An ADF node type this version does not know is not an error: the lossless pair carries it opaquely
unchanged ([`docs/decisions.md`](https://gitea.larvit.se/larvit/adf-codec/src/branch/main/docs/decisions.md#unknown-nodes-ride-the-carry)). 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`, `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 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 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 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`. 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`, Where a container's own spelling cannot hold the child it has — a `bulletList` holding other than
a `codeBlock` outside text — the error result names that instead. `listItem`, a `codeBlock` other than text — the error result names that instead.
## Foreign HTML sorts three ways ## Foreign HTML sorts three ways
@@ -131,11 +131,10 @@ accepted.
node with no `localId`. node with no `localId`.
`plainMarkdownToAdf` gives each `taskList`, `taskItem` and `blockTaskItem` lacking one a `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 in the editor's UUID v4 shape, hashed from the whole markdown and the node's order among those it
document order, skipping any id the document holds. A site rejecting a missing `localId` takes the mints, skipping any id the document holds: the same markdown reads to the same ids every run,
document, the same markdown reads to the same ids every run, and different markdown to ids no other different markdown to different ids. The same markdown pasted twice into one document repeats its
document shares. The same markdown pasted twice into one document repeats its ids: determinism ids: determinism wins over that case. A node the carry restores stays deep-equal (§Unknown nodes ride the carry): its
wins over that case. A node the carry restores stays deep-equal (§Unknown nodes ride the carry): its
ids are only skipped. ids are only skipped.
## A callout title keeps its link targets ## A callout title keeps its link targets