Keep quoted code and diffs exact inside cards - #3
Open
MagMueller wants to merge 1 commit into
Open
Conversation
MagMueller
force-pushed
the
fix/preserve-literal-card-evidence
branch
from
September 11, 2026 19:21
45e6d58 to
a0ec44b
Compare
MagMueller
force-pushed
the
fix/preserve-literal-card-evidence
branch
from
September 11, 2026 20:26
a0ec44b to
1520ec4
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What changes
Restore protected card HTML with a replacement callback, so JavaScript treats the
saved code, source quote or diff as literal text.
Previously
$$became$,$&inserted the placeholder itself, and the prefixand suffix replacement tokens could duplicate surrounding HTML. This could make
an original source or patch shown inside an Agency card differ from its artifact.
The fix changes one restoration expression. It preserves the existing reverse
restoration order and authored-prose normalization.
Validation
replacement-token corruptions in an ordinary protected code block.
stored card context and repeated normalization.
Limits
No schema, dependency, sorting, scoring, approval or status change. This prevents
future corruption; it does not reconstruct previously corrupted stored content.
Synthetic fixtures only. No private card content or customer data is included.
Summary by cubic
Fixes corruption of protected card content during dash normalization so saved code, diffs, and quotes restore as literal text.
Previously
$$,$&,$``, and$'` in protected blocks were interpreted as replacement patterns, altering the original source or patch shown in cards. Restoration now uses a replacement callback, preserving saved content exactly.Written for commit 1520ec4. Summary will update on new commits.