Repository navigation
Conversation
Salvage of closed archive PR #7374 (task 14087, issue #7297). The save path mints a bare `idweb-spaced-destination-{n}-placeholder` token per whitespace-carrying link/image destination and restores it with a plain `str::replace`. A document whose own text contains that token therefore has its words rewritten on save, and the replacement is not confined to destination positions. - Mint placeholders against the document: `ast_contains_literal` scans the converted AST (text, code, html, code-block info, link/image url and title, plus a Debug fallback for every other node kind), and `fresh_spaced_destination_placeholder` skips taken or colliding candidates. - Restore positionally: `restore_spaced_destination` rewrites the token only where it is a rendered destination (after `](`, followed by `)`, whitespace, or a title opener). - Read the destination before minting: the collision scan borrows the AST immutably, so the old `&mut link.url` borrow would panic. - Regression test covers literal text, code span, fenced block, several colliding literals with a deduped destination, and a titled one.
Codex Review Summary: ❌ FailedThis 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. |
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
|
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 48 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:v1 Closing this PR as superseded — its change is already on main in a strictly stronger form, verified fresh 2026-11-14:
No branch deletion while closing per packet scope note is moot (branch can be cleaned up by janitor); the PR itself is closed with this evidence. |
Salvage of closed archive PR #7374 (task 14087, issue #7297, archive batch 1/5).
What was in the archive PR
archive/janitor-2026-11-07/1348-triage(tipc8db2977e4) touched exactly onefile,
pkgs/id/src/web/markdown.rs, with the #1348 fix "collision-proofspaced-destination placeholders on save". It was closed unmerged in the
2026-11-08 archive disposition; salvage validation (task 13628) found its
content still absent from
main.Verified against
origin/mainate8b179f711:mainstill has the naiveform — placeholders minted as
idweb-spaced-destination-{substitutions.len()}-placeholderand restored with a bare
str::replace. So the remainder was not obsolete.The bug
A document whose own text contains the placeholder token has its words
rewritten on save: the literal paragraph text
idweb-spaced-destination-0-placeholderis replaced by
<my notes.md>(the angle-form destination), because therestoration is a whole-output
str::replacerather than a positional one.Fix (ported from the archive tip, byte-identical)
ast_contains_literal— scans the converted AST for a candidate token:text, code, html inline/block, code-block literal and info string,
link/image url and title, plus a
Debugfallback for every otherstring-carrying node kind.
fresh_spaced_destination_placeholder— mints a token that occursnowhere in the document, advancing a counter past skipped indices.
restore_spaced_destination— rewrites a token only where it is arendered destination (immediately after
](, followed by),whitespace, or a title opener), so prose and code are never touched.
substitute_spaced_destinationsreads the destination before minting:the collision scan borrows the AST immutably, so the previous
&mut link.urlborrow would panic inRefCell.Verification
cargo test --features web --lib web::markdown— 267 passed, 0 failed,including the new
test_spaced_destination_placeholder_collision_preserves_literal_text.main's shape makesthat test fail with
left: "<my notes.md>\n\n[notes](<my notes.md>)\n",confirming it is a real regression test and not a tautology.
rustfmt --checkon the file: the added regions are clean (the file'spre-existing drift at 10 unrelated spots is untouched; formatting is not a
merge gate per
.github/ci-policy.md).Scope
No reopening of #7374, no archive branch recreated. Content recovered from
refs/pull/7374/head.Closes #7297 (this batch part).
Refs #1348
Open in [code]smith · Need help on this PR? Tag
@codesmith-botwith what you need.