GeezerVison is showing github.com — fix(shared): Markdown previews show bracketed prose once by StiensWout · Pull Request #43814 · pingdotgg/t3code
Conversation
Chunked Markdown previews could repeat ordinary text that resembled a link reference definition. The splitter now shares only single-line definitions whose labels meet the renderer’s bracket, whitespace, and length rules. Bare carriage returns inside a candidate keep it out of the shared prefix, while valid definitions with CRLF endings still resolve across chunks.
Related: #43647, #43654, #34144, #23503, #43673, #43709, #43711
Reproduction on main
Commit f08bafe07f (main), in the running web app:
- Start the web app and open a project.
- Put a Markdown file in that project whose first line is [Release [candidate]: https://example.com/releases, followed by a blank line and the line Publish the notes.
- Open that file from the project's files.
- Click Show rendered markdown.
The line [Release [candidate]: https://example.com/releases appears twice, followed by Publish the notes. Expected: The line [Release [candidate]: https://example.com/releases appears once, followed by Publish the notes.
The cause is at packages/shared/src/markdownChunks.ts:103. Ran pnpm scenarios:prove scripts/scenarios/markdown-bracketed-label-renders-once.e2e.ts --target web with the repro scenario added: it failed in 2 of 2 runs on a clean checkout, with expect.toHaveCount failed in the output.
Evidence
Environment: The web app in Chromium on Linux x64, a fresh checkout.
Proven: the repro fails at the test commit 6a27adafa1 and passes on the head 0ea50e2e98, both on main 43530f99e7.
|
Before |
After |
| Commit |
6a27adafa1 |
0ea50e2e98 |
| Result |
ASSERTION_FAILED: expect.toHaveCount failed |
passed |
| bracketed text line |
 |
 |
| failure |
 |
|
Before the fix, recorded:
https://pub-b182a4071edc4521829926b34990540b.r2.dev/files/eb27ba64-ec37-43b6-9be1-d74101641490/before-recording.webm
After the fix, recorded:
https://pub-b182a4071edc4521829926b34990540b.r2.dev/files/c8fa29a9-5001-4649-be0f-7cfc2845ae80/after-recording.webm
Outside view: a person sees it in the running web app by following the steps under Reproduction on main.
Tests
- 6a27adafa1 adds the failing test, alone, before the fix.
pnpm exec vp run check:changed 43530f99e7ee875fc1eec09d3a6cb7ea34ce70ba passed on head.
Not in this change
- Multiline definitions and footnotes resolve within their own chunk. This applies to multiline definitions with bare carriage returns as well as LF and CRLF.
- Mobile uses the shared splitter. Native rendering was not exercised separately.
Who did the work
- Repro written by GPT 6.2 Sol, in Codex
- Outside view by Grok 4.7, in Grok
- Duplicate check judged by Claude Opus 5.5, in Claude Code
- Written by GPT 6.2 Sol, in Codex
- Trimmed by Claude Opus 5.5, in Claude Code
- Reviewed by Claude Opus 5.5, in Claude Code, and by GPT 6.2 Sol, in Codex, and by Gemini 4 Neon, in Antigravity
- Reproduction, checks and proof run by a program on base and head, not by an agent
Made in T3 Code by GPT 6.2 Sol, Claude Opus 5.5, Grok 4.7 and Gemini 4 Neon
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
The label group always matches, and a label without tabs has the same width as its length, so the empty-label guard, the separate length check and the tab guard go.
Co-authored-by: Claude Opus 5.5 <[email protected]>
The heading, blockquote, fence and spaced blank-line rows reach the same interior-CR check as the continuation row.
Co-authored-by: Claude Opus 5.5 <[email protected]>
coderabbitai
Bot
commented
Nov 26, 2026
•
edited
Loading
Uh oh!
There was an error while loading. Please reload this page.
|

No actionable comments were generated in the recent review.
Walkthrough
-
The change preserves leading indentation when extracting Markdown link definitions. Tests cover label parsing boundaries and carriage-return handling when shared definitions are reapplied.
Changes: Markdown link-definition parsing
| Layer / File(s) |
Summary |
Definition extraction and parsing tests packages/shared/src/markdownChunks.ts, packages/shared/src/markdownChunks.test.ts |
Extraction now includes the source line’s leading indentation. Tests cover label parsing cases and verify that bare carriage returns do not alter later chunks when shared definitions are reapplied. |
Estimated code review effort: 2 (Simple) | ~10 minutes
Change: Bug fix
Suggested reviewers: saphid, juliusmarminge
Merge Risk: Minimal · up to e63d7
-
This change stops bracketed prose in chunked Markdown previews from appearing twice. No merge-blocking risk was found in the supplied changes.
Pre-merge checks: 4
-
| Check name |
Status |
Explanation |
| Title check |
 |
The title names the main change: Markdown previews of bracketed prose no longer repeat a line that resembles a link reference definition. It uses the conventional commit form with the shared scope, an… |
| Description check |
 |
The description follows the template. It gives a problem statement with reproduction steps, explains the change in the splitter, links related issues, and includes verification with test results, befo… |
| 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: Markdown previews of bracketed prose no longer repeat a line that resembles a link reference definition. It uses the conventional commit form with the shared scope, and the changeset (markdownChunks.ts and its tests) matches it. The title is specific and concise.
Full details: Description check
-
Explanation
The description follows the template. It gives a problem statement with reproduction steps, explains the change in the splitter, links related issues, and includes verification with test results, before/after evidence, and a 'not in this change' section. The template asks for a Scope section that links the bug issue or explains why no issue is needed. The description links related numbers (#43647 and others) but does not state clearly that they are the bug issue, nor does it explain why no issue is needed. The Scope section is therefore only partly addressed. The description is otherwise mostly complete.
Finishing Touches
-
Generate unit tests (beta)
-
- 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 34624ae and e63d7f8.
Files selected for processing: 2
-
packages/shared/src/markdownChunks.test.ts
packages/shared/src/markdownChunks.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
Opened a fresh synthetic project thread → right panel → Files → release.md → Show rendered markdown. The file contains the bracketed line once, a blank line, and “Publish the notes.” Both runs used the real web app, Replay dev provider, fresh databases, a 1280×800 viewport, and light theme.
Reproduction scenario. scenarios:prove exited 0: fails on base and passes on head.
Not shown:
- Bare carriage returns affecting later chunks were not exercised because the supplied reproduction contains only LF line endings.
- Valid reference definitions resolving across chunks and other label-validation changes were not exercised by this minimal bracketed-prose reproduction.
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
…prose once
Main's remark-based definition reader (pingdotgg#43807) already rejects invalid labels, so it replaces this branch's one-line matcher. Kept the label tests, kept definition indentation so tabbed labels keep their width, and dropped the scenario that main now passes.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
|
The automated pipeline ran the reported steps in the real app without this change, and the problem did not appear. So it cannot show that this change fixes anything.
What was run on 3ebc46f867, the commit before this change:
Created a project containing only release.md with exactly '[Release [candidate]: https://example.com/releases\n\nPublish the notes.\n'. Created and opened a Replay thread, opened the right panel, selected Files, clicked release.md, and clicked Show rendered markdown. Captured the preview and checked that the bracketed line appeared once. Both sides displayed it once, followed by Publish the notes. The final scenario comparison exited 1 because both sides passed.
How: scenarios:prove drove the real web app with fresh isolated server state, a Replay thread, and identical 1280×800 light-theme browser views on both commits. Both final captures were opened and visually inspected.
Closing this pull request. If you can share the exact steps, what you see, and the version and platform you are on, it can be reopened.
|
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.
Assignees
No one assigned
Labels
size:XS
0-9 changed lines (additions + deletions).
takeover:blocked
Takeover blocked; reason in the PR body
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.
|