Repository navigation
Conversation
…ocument (#1348) The index-only placeholder token could already occur in the document text, and the global restore replace then rewrote the document own words into the spaced destination. substitute_spaced_destinations now scans a corpus of all rendered literals and link/image urls and titles and extends the token until absent from it, mirroring the parse-side protect_newline_destinations discipline. Regression test: literal token prose plus a spaced destination round-trips unchanged.
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
Warning Review limit reachedYou've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Next included review available in 12 minutes. View limit details
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. |
|
🤖 Agent note · laptop verification detail — queue worker (repo-worker-code), lane code-b, task 11937. The detached laptop run finished: |
|
state: closed-already-done Closing PR #9006 as already done — the #1348 fix landed via PR #4665 in a fuller form. Fresh evidence (2026-11-14, task 17192):
|
What
Fixes #1348: the save direction's spaced-destination placeholder (
idweb-spaced-destination-<n>-placeholder, chosen from the substitution index only) could collide with the document's own text. Restoration is a globalstr::replaceover the rendered document, so a document containing the literal token plus a spaced link/image destination had its own words rewritten into<the spaced destination>— silent content corruption on save.Change (
pkgs/id/src/web/markdown/markdown_serialization.rs, +33/-1)substitute_spaced_destinationsnow builds a corpus of everything that can reach the rendered output — text/code/html literals and every link/image url and title in the AST — and extends each placeholder token (placeholder.push('x')) until it is absent from that corpus, so the global restore replace can only ever match a destination this substitution planted. This mirrors the collision-safe token disciplineprotect_newline_destinationsalready uses on the parse side (#1423). Deterministic, no new dependencies, dedupe of identical destinations unchanged.Tests
test_spaced_destination_placeholder_token_in_document_text_survivesinpkgs/id/src/web/markdown.rs— prose containing the literalidweb-spaced-destination-0-placeholderplus a spaced link destination round-trips byte-identically (literal text unchanged, destination in<...>angle form) and is a fixpoint.Verification status: the workspace compiled with this change on the laptop and the test binaries ran (first targeted run used an over-specific filter and matched 0 tests); a correctly-filtered laptop run queued behind fleet build-lock contention as detached job d186a89d13fe, log /tmp/test1348-code-b.log on the laptop. CI on this PR is the deciding verification.
🤖 Queue worker lane code-b, task 11937.