GeezerVison is showing github.com — fix(shared): copying a Codex citation with a pipe in its filename preserves the table row by saphid · Pull Request #43765 · pingdotgg/t3code
Conversation
Problem
When a Codex file citation inside a Markdown table names a file containing | (for example reports/a|b.txt encoded as | in the directive attribute), copying the message or converting inline citations to Markdown emits literal | characters in both the link label and angle-bracketed destination. Reparsing that Markdown splits the table row at those pipes, breaking the file link and dropping the adjacent cell.
Deterministic repro on origin/main (9b4943f91cf8de7f376b73d4a7299fe74b54d044):
Pass the fixture below through wordsHast before and after renderCodexDirectivesForCopy (from apps/web/src/markdown/wordsHast.ts and apps/web/src/markdown/markdownText.ts), or through renderCodexDirectivesForCopy / renderCodexInlineDirectivesAsMarkdown in packages/shared/src/codexMarkdownDirectives.ts followed by remark-parse + remark-gfm:
| File | Note |
| --- | --- |
| :codex-file-citation{path="reports/a|b.txt"} | ok |
- Observed:
wordsHast initially renders <a href="./reports/a%7Cb.txt">a|b.txt</a> and a second cell ok. Copy emits | [a|b.txt](<./reports/a|b.txt>) | ok |; reparsing with wordsHast produces cells [a and b.txt](<./reports/a, with no link and ok dropped (remark-gfm splits the row into 4 cells instead of 2).
- Expected: Reparsing the copied row produces the same two cells,
a|b.txt file link to ./reports/a%7Cb.txt, and ok cell as the original.
Change
Escape | as \| in markdownLabel and percent-encode | as %7C in markdownDestination inside packages/shared/src/codexFileCitations.ts. Because codexFileCitationMarkdown is shared across packages/shared/src/codexMarkdownDirectives.ts (mobile rendering, search, shared copy) and apps/web/src/markdown/markdownText.ts (web and desktop copy/link extraction), this single change fixes all surfaces. Added unit and GFM table copy-and-reparse regression tests in packages/shared/src/codexFileCitations.test.ts and packages/shared/src/codexMarkdownDirectives.test.ts.
Scope
Small fix for an obvious bug; no issue needed under CONTRIBUTING.md.
Verification
- Base failure (
origin/main 9b4943f91cf8de7f376b73d4a7299fe74b54d044): vp test run packages/shared/src/codexFileCitations.test.ts packages/shared/src/codexMarkdownDirectives.test.ts failed 3/39 tests (codexFileCitationMarkdown emitted unescaped | in label and destination; both renderCodexDirectivesForCopy and renderCodexInlineDirectivesAsMarkdown split the 2-column GFM table row into 4 cells).
- Head pass (
5a39c93062fe1283bd92cc7868f418ae4192dc48):
- 3/3 consecutive runs of
vp test run packages/shared/src/codexFileCitations.test.ts packages/shared/src/codexMarkdownDirectives.test.ts passed (39/39 tests each).
vp run check:changed exited 0 (format, lint, knip 1/2 & 2/2, typecheck across 37 packages, and 3 affected test files / 41 tests).
- Runtime
wordsHast + renderCodexDirectivesForCopy check in apps/web confirmed copied Markdown | [a\|b.txt](<./reports/a%7Cb.txt>) | ok | re-renders to the exact same HTML table as the original (origHtml === afterHtml).
- Before/after transcript: https://gist.github.com/saphid/a806371e43fbc35770dbd1bf36b80eff
- Not shown: Interactive browser/desktop/mobile UI click-to-copy smoke test (this change is pure Markdown serialization in
packages/shared covered by wordsHast and remark-gfm round-trip verification).
Authored by Gemini 4 Neon (Antigravity); reviewed by GPT-6.1 Sol (Codex).
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
coderabbitai
Bot
commented
Nov 26, 2026
•
edited
Loading
Uh oh!
There was an error while loading. Please reload this page.
|

Important
Review skipped
Review was skipped as selected files did not have any reviewable changes.
Run configuration
-
Commits
-
Reviewing files that changed from the base of the PR and between 5a39c93 and 64159a2.
You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.
Use the checkbox below for a quick retry:
No actionable comments were generated in the recent review.
Walkthrough
-
File citations now escape vertical bars in Markdown labels and encode them as %7C in destinations. Tests cover generated Markdown and round-trip parsing in a GFM table.
Changes: File Citation Encoding
| Layer / File(s) |
Summary |
Citation encoding and GFM round-trip packages/shared/src/codexFileCitations.ts, packages/shared/src/codexFileCitations.test.ts, packages/shared/src/codexMarkdownDirectives.test.ts |
Markdown labels escape vertical bars, and link destinations encode them as %7C. Tests verify the generated citation and confirm that a pipe-containing path parses back correctly without breaking a GFM table. |
Estimated code review effort: 2 (Simple) | ~8 minutes
Change: Bug fix
Merge Risk: Minimal · previous review 5a39c
-
Copying a file citation whose name contains a pipe should now keep the surrounding table row intact. The change is narrow and tested, and no merge-blocking risk was found.
Pre-merge checks: 4
-
| Check name |
Status |
Explanation |
| Title check |
 |
The title names the main change: copying a Codex citation whose filename contains a pipe no longer breaks the Markdown table row. It matches the raw summary (escaping | in the label, percent-encodin… |
| Description check |
 |
The description follows the template well. It has Problem, Change, Scope, and Verification sections. The Problem section gives a reproduction and expected behavior. The Change section explains the sin… |
| Linked Issues check |
 |
Check skipped because no linked issues were found for this pull request. |
| Out of Scope Changes check |
 |
Check skipped because no linked issues were found for this pull request. |
Full details: Title check
-
Explanation
The title names the main change: copying a Codex citation whose filename contains a pipe no longer breaks the Markdown table row. It matches the raw summary (escaping | in the label, percent-encoding it in the destination) and the PR objectives. It is specific and follows the conventional commit form, and it is about 89 characters, slightly longer than ideal.
Full details: Description check
-
Explanation
The description follows the template well. It has Problem, Change, Scope, and Verification sections. The Problem section gives a reproduction and expected behavior. The Change section explains the single shared-serialization fix. Scope explains why no issue is needed. Verification lists base and head test results, a check run, a runtime round-trip, and a transcript link, and it states what was not checked (interactive UI click-to-copy). The template's agent-attribution line is present (model and harness named). The description is mostly complete.
Finishing Touches
-
Generate unit tests (beta)
-
Fix failing CI checks
-
- Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Recent review info
-
Run configuration
-
Commits
-
Reviewing files that changed from the base of the PR and between 09f2741 and 5a39c93.
Files selected for processing: 3
-
packages/shared/src/codexFileCitations.test.ts
packages/shared/src/codexFileCitations.ts
packages/shared/src/codexMarkdownDirectives.test.ts
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 0 remain after this review.
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
Evidence
Copy the reported assistant citation table, save its clipboard Markdown as copied.md, then open its rendered preview. Real Chromium web client, 1280×800, light theme, fresh synthetic state on each commit. scenarios:prove exited 0.

Scenario and synthetic replay seed
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Assignees
No one assigned
Labels
size:XS
0-9 changed lines (additions + deletions).
vouch:trusted
Author is trusted by repo permissions or the VOUCHED list.
Milestone
No milestone
Development
Successfully merging this pull request may close these issues.
Uh oh!
There was an error while loading. Please reload this page.
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.
|