40 - plan exact deep-equality for the round-trip, replacing 39 #143

Merged
lilleman merged 1 commits from plan-40 into main 2026-09-28 21:50:16 +02:00
2 changed files with 7 additions and 4 deletions
Showing only changes of commit 23804a5b3a - Show all commits
+1
View File
@@ -39,6 +39,7 @@ merges.
"Equals" is structural equality over editor-normal ADF — adjacent text nodes with identical marks "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 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. 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 ## Unknown nodes ride the carry
+6 -4
View File
@@ -2,10 +2,6 @@
## 0.2.0 ## 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 - **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 `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 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 - **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 task ids come from position, README §Plain markdown's `localId` bullet saying so. The id spelling
is part of the chunk. 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 - **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 opaque-carry form, and the documented foreign-element set `htmlToAdf` accepts — the set
`markdownToAdf` shares (`spec/flavour.md` §Raw HTML in input). `markdownToAdf` shares (`spec/flavour.md` §Raw HTML in input).