From 23804a5b3a5411fc28fa5e0631d6a27320076208 Mon Sep 17 00:00:00 2001 From: Lilleman auf Larv Date: Mon, 28 Sep 2026 21:39:47 +0200 Subject: [PATCH] 40 - plan exact deep-equality for the round-trip, replacing 39 --- docs/decisions.md | 1 + todo.md | 10 ++++++---- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/docs/decisions.md b/docs/decisions.md index e5f9d24..4f5c0b6 100644 --- a/docs/decisions.md +++ b/docs/decisions.md @@ -39,6 +39,7 @@ merges. "Equals" is structural equality over editor-normal ADF — adjacent text nodes with identical marks and no attributes merged, JSON number semantics, an empty attrs object, marks array or content array the absent key — the only domain markdown can restore. +Replaced by deep equality with `todo.md` 40 (2026-09-28, the maintainer). ## Unknown nodes ride the carry diff --git a/todo.md b/todo.md index f119bfc..815748a 100644 --- a/todo.md +++ b/todo.md @@ -2,10 +2,6 @@ ## 0.2.0 -- **39 — Export `sameAdf(a, b)`, the equality README §The guarantees means.** Per Goal 7, it answers - whether two documents are equal editor-normal (`docs/decisions.md` §Equality is editor-normal), and - the guarantees' "equals `doc`" names it, since a deep-equal fails on a valid document holding an - empty `attrs` or two adjacent text nodes with the same marks. - **35 — Read and write plain markdown as a flavour of the markdown grammar.** Per Goal 2 and `docs/decisions.md` §Plain markdown is a flavour of the grammar, README §Plain markdown's rows are read by `markdownToAdf`'s parser and written by `adfToMarkdown`'s writer, and the lift goes. The @@ -28,6 +24,12 @@ - **10f — Give task nodes read from plain markdown position ids.** Per `docs/decisions.md` §Plain task ids come from position, README §Plain markdown's `localId` bullet saying so. The id spelling is part of the chunk. +- **40 — Make `markdownToAdf(adfToMarkdown(doc))` deep-equal `doc` for every document it takes.** + Today it holds for editor-normal documents only: two adjacent text nodes with the same marks + merge, an empty `attrs`, `marks` or `content` drops, and `-0` reads back `0` — shapes pipelines + and bots build. Spell each so it reads back as written, CommonMark's spelling kept wherever none + occurs; the spellings are part of the chunk. `docs/decisions.md` §Equality is editor-normal, + `spec/flavour.md` and `corpus/README.md` follow, and the tests drop `toEditorNormal`. - **6 — Specify the HTML dialect.** Element-by-element mapping, the `data-*` fidelity scheme, the opaque-carry form, and the documented foreign-element set `htmlToAdf` accepts — the set `markdownToAdf` shares (`spec/flavour.md` §Raw HTML in input).