content: global find/replace (find-replace.sx) + 10 tests (615/615)
Some checks failed
Test, Build, and Deploy / test-build-deploy (push) Failing after 52s

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-06-07 04:20:02 +00:00
parent 49af154524
commit b8ead3c223
6 changed files with 128 additions and 5 deletions

View File

@@ -19,7 +19,7 @@ injected adapter, not core.
## Status (rolling)
`bash lib/content/conformance.sh`**605/605** (Phases 14 COMPLETE + extensions: HTML/SX escaping, Markdown render + import/export incl. tables & frontmatter (full round-trip), CRDT replication, tree-aware validation, snapshot cache, doc metadata, plain-text render, nested block trees + deep tree editing, doc stats, table block, HTML page wrapper + SEO page, doc composition + id-remap, portable data + wire serialization, block query + transforms, TOC rendering, normalization)
`bash lib/content/conformance.sh`**615/615** (Phases 14 COMPLETE + extensions: HTML/SX escaping, Markdown render + import/export incl. tables & frontmatter (full round-trip), CRDT replication, tree-aware validation, snapshot cache, doc metadata, plain-text render, nested block trees + deep tree editing, doc stats, table block, HTML page wrapper + SEO page, doc composition + id-remap, portable data + wire serialization, block query + transforms + find/replace, TOC rendering, normalization)
## Ground rules
@@ -98,11 +98,17 @@ lib/content/api.sx ── (content/edit) (content/render) (content/history) ─
- [x] block transforms (`transform.sx`: content/map-blocks/map-type/set-field-on)
- [x] TOC rendering (`toc.sx`: content/toc-markdown + toc-html from headings)
- [x] document normalization (`normalize.sx`: content/normalize, drop empty blocks/sections)
- [x] global find/replace (`find-replace.sx`: content/find-replace across text-bearing blocks)
- [x] portable data serialization (`data.sx`: content/to-data + from-data, round-trips tree)
- [x] wire serialization (`wire.sx`: content/to-wire + from-wire, SX-text on the wire)
## Progress log
- 2026-06-07 — Extension: global find/replace (`find-replace.sx`).
`content/find-replace` replaces every occurrence of a substring in the text
field of text/heading/code/quote blocks tree-wide (via the transform layer) —
rename a term throughout a doc. Leaves non-text fields (image alt/src) alone;
immutable, case-sensitive. 10 tests; suite 615/615.
- 2026-06-07 — Extension: document normalization (`normalize.sx`).
`content/normalize` drops empty text blocks and empty sections tree-wide;
sections are normalised first so one emptied by the pass is itself removed.