GeezerVison is showing github.com — fix(shared): bare <a> placeholders no longer disable absolute file-path linking for the rest of a message by saphid · Pull Request #43741 · pingdotgg/t3code
Conversation
Problem
An unclosed bare <a> or <a/> placeholder in a message prevents remarkLinkAbsoluteFilePaths from linking every subsequent absolute file path in the message. remarkLinkAbsoluteFilePaths runs before rehypePreserveBareAnchorPlaceholders and increments rawAnchorDepth for any <a...> HTML tag without skipping unmatched bare placeholders or raw-text elements (such as <textarea><a></textarea>), leaving rawAnchorDepth > 0 for the rest of the AST. As a result, searchableMessageSegments in packages/shared/src/threadFindText.ts indexes raw paths instead of rendered file-chip labels (e.g. app.ts · L42), breaking in-thread find (Ctrl+F) even though wordsHast renders the chip.
Deterministic repro on origin/main (a066eb0935da44bbb16571638138c218bfdbf775):
- Message fixture (or Replay turn in
vp run scenarios:prove):
Use <a> for links.
See /Users/me/app.ts:42
- Open the thread, press
Ctrl+F, and search for app.ts · L42 (or run from packages/shared):
node --input-type=module -e 'import { searchableMessageSegments } from "./src/threadFindText.ts"; console.log(JSON.stringify(searchableMessageSegments({ role: "assistant", text: "Use <a> for links.\n\nSee /Users/me/app.ts:42", streaming: false })));'
- Observed on
origin/main: In-thread find reports 0/0 for app.ts · L42 even though the app.ts · L42 file chip is visible, and searchableMessageSegments returns ["Use <a> for links.","See /Users/me/app.ts:42"]. <a/> fails identically.
- Expected: In-thread find reports
1/1 and highlights app.ts · L42, and searchableMessageSegments returns ["Use <a> for links.","See app.ts · L42"].
Change
Generalized the existing raw-HTML anchor scanner in packages/shared/src/markdownPipeline.ts (scanRawHtmlAnchors) so rehypePreserveBareAnchorPlaceholders and remarkLinkAbsoluteFilePaths share one pass over raw-text tags and unmatched bare <a>/<a/> placeholders. remarkLinkAbsoluteFilePaths now ignores unmatched bare placeholders while continuing to skip auto-linking inside matched <a>...</a> (including <a/>...</a>), attributed <a ...> tags, and raw-text elements.
Surface check: web and desktop share packages/shared/src/markdownPipeline.ts for thread search (threadFindText.ts) while rendering via apps/web/src/markdown/wordsHast.ts (which already unwraps bare <a>/<a/> before linking absolute file paths); mobile (apps/mobile/src/lib/markdownDocument.ts) does not suppress prose file-path linking on raw HTML <a> tags. No contract, provider, or i18n copy changes apply.
Scope
Small fix for an obvious bug; no issue needed under CONTRIBUTING.md.
Verification
- Base failure (
origin/main a066eb0935da44bbb16571638138c218bfdbf775): Extended packages/shared/src/markdownPipeline.test.ts (links complete absolute paths in prose and skips shortened ones) and ran vp test run packages/shared/src/markdownPipeline.test.ts -t "links complete absolute paths" — failed with AssertionError: expected [] to deeply equal [ '/Users/me/app.ts:42' ].
- Head pass (3/3 consecutive runs):
vp test run packages/shared/src/markdownPipeline.test.ts packages/shared/src/threadFindText.test.ts passed 3/3 times (46/46 tests each).
- Changed-files gate:
vp run check:changed exited 0 (format, lint, knip 1/2 & 2/2, typecheck across 37 packages, affected tests 2 files / 28 tests).
- Real-app integrated proof (
vp run scenarios:prove --base origin/main): Replayed "Use <a> for links.\n\nSee /Users/me/app.ts:42" in the real web client and searched Ctrl+F for app.ts · L42: failed on base a066eb0935da (0/0, ASSERTION_FAILED) and passed on head 065b89326db2 (1/1 highlighted match).
Base (a066eb0935da) — 0/0 |
Head (065b89326db2) — 1/1 |
 |
 |
- Before/after runtime transcript & captures: https://gist.github.com/saphid/a31dbadf9d82e75634bf6435e2d811ee
- Not shown: Electron desktop wrapper and native mobile app were not run separately; desktop renders the same web bundle and
threadFindText pipeline, and mobile links prose paths independently in apps/mobile/src/lib/markdownDocument.ts.
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.
…th linking for the rest of a message
coderabbitai
Bot
commented
Nov 26, 2026
•
edited
Loading
Uh oh!
There was an error while loading. Please reload this page.
|

Walkthrough
-
The markdown pipeline now tracks text inside raw HTML anchors. Absolute file path linking skips text inside anchors. Tests cover paths around anchor markup, malformed anchors, and textarea content.
Changes: Anchor-aware path linking
| Layer / File(s) |
Summary |
Scan HTML anchor content packages/shared/src/markdownPipeline.ts |
A shared scanner tracks anchor nesting and identifies text inside anchors. It identifies unmatched bare anchors for conversion to text. |
Apply anchor scan to path linking packages/shared/src/markdownPipeline.ts, packages/shared/src/markdownPipeline.test.ts |
Absolute file path linking skips text inside HTML anchors. Tests cover paths inside and outside anchors, after malformed anchor markup, and inside textarea content. |
Estimated code review effort: 2 (Simple) | ~10 minutes
Change: Bug fix
Suggested reviewers: juliusmarminge
Merge Risk: Low · up to ef335
-
The change fixes file-chip search after unmatched bare anchor placeholders. Two minor edge cases remain: paths after an end tag with attributes may stay unlinked, and messages with very many repeated placeholders may be slow to classify. Neither blocks the main fix, but both are worth addressing.
Pre-merge checks: 4
-
| Check name |
Status |
Explanation |
| Title check |
 |
The title names the main change: unmatched bare placeholders no longer disable absolute file-path linking for the rest of a message. The raw summary and objectives describe the same fix in markdow… |
| Description check |
 |
The description follows the template. It has Problem, Change, Scope, and Verification sections. The Problem section gives the cause, the reproduction steps, and expected and observed behavior. The Cha… |
| 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: unmatched bare <a> placeholders no longer disable absolute file-path linking for the rest of a message. The raw summary and objectives describe the same fix in markdownPipeline.ts, so the title matches the changeset. It is long at 105 characters, but it is specific and accurate.
Full details: Description check
-
Explanation
The description follows the template. It has Problem, Change, Scope, and Verification sections. The Problem section gives the cause, the reproduction steps, and expected and observed behavior. The Change section explains the scanner refactor and surface checks. The Scope section explains why no issue is linked. The Verification section gives a base failure, head passes, a check run, and a real-app proof with screenshots. It also states what was not checked (Electron and native mobile). It names the model and harness in the authorship line, as the template asks. Minor gap: the Scope section links no issue and gives a reason instead, which the template allows for small obvious fixes.
Finishing Touches
-
Generate unit tests (beta)
-
- Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
…HTML scanner
The scanner now returns the bare anchors and an insideAnchor check; only the
rehype plugin turns bare anchors into text. Drops a duplicate test assertion.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
…ss later file-path links
The anchor scanner skips link and linkReference subtrees when it reads mdast,
as the path linker always did.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
# Conflicts:
# packages/shared/src/markdownPipeline.test.ts
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Evidence
Replay the three reported assistant replies (, , plain control), open the thread, then Ctrl+F → app.ts · L42. Chromium web client, fresh isolated state, 1280×800, light theme on both sides.
Scenario driver. scenarios:prove exited 0: fails on base, passes on head.
Not shown:
- Suppression inside real anchors and raw-text elements was not exercised by this three-reply reproduction.
- Previous/next navigation and the intermediate single-reply 0/0 state were not exercised; the captured comparison verifies the final three-reply search count.
|
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.
This was referenced Nov 27, 2026
Uh oh!
There was an error while loading. Please reload this page.
Assignees
No one assigned
Labels
size:M
30-99 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.
|