GeezerVison is showing github.com — fix(web): heading ids match GitHub's anchors for ², ① and Persian text by only21mil · Pull Request #44475 · pingdotgg/t3code
Conversation
Problem
A #anchor link written on GitHub does nothing in T3 when the heading has a superscript, a circled number or a fraction, or uses a zero-width joiner or non-joiner, as emoji sequences and Persian words do. For ## Area of r² GitHub's anchor is #area-of-r, but T3 gives the heading user-content-area-of-r², so clicking [Area](#area-of-r) finds no target. It affects chat replies, PR bodies and comments, and Markdown file previews.
Change
githubHeadingSlug kept every \p{N} and dropped every symbol and joiner. GitHub keeps Ruby's \p{Word} (UTS #18 \w): Alphabetic, marks, decimal digits, connector punctuation and Join_Control, plus spaces and hyphens. The regex now keeps exactly that class. Plain Latin, accented, Cyrillic, CJK and Arabic headings get the same ids as before.
Scope
A small fix for an obvious bug, so it needs no issue: the function exists to produce GitHub's anchors (#16950). One regex line and one comment in apps/web, plus a new unit test file. No new dependency.
Verification
Setup: Linux, an unseeded vp run dev test server, a synthetic project with one ANCHORS.md holding links to #area-of-r, #step- and #میخواهم above long filler.
Steps: open the file in the Files panel → rendered Markdown → click Area of r².
| Before (main) |
After (this PR) |
 |
 |
On main the heading stays off screen. With this change all three links scroll to their headings, and the URL is unchanged.
GitHub check: an AI agent rendered a heading for every code point from U+0020 to U+1FFFF (128,988 headings) through GitHub's Markdown API and compared the user-content- ids. The new slug matches all of them. The old one differs on 1,047.
| Heading |
GitHub |
Before |
After |
Area of r² |
area-of-r |
area-of-r² |
area-of-r |
Step ① |
step- |
step-① |
step- |
aⒶb |
aⓐb |
ab |
aⓐb |
میخواهم |
keeps the ZWNJ |
drops it |
keeps it |
markdownFragments.test.ts covers 8 headings with GitHub's ids. 6 fail on main and all pass here. With the wordsHast and markdownStreamBlocks unit tests and the ChatMarkdown browser tests, 190 tests pass, and so does vp run check:changed.
Not shown
- Chat and PR-body rendering share this slug through
wordsHast, so only the file preview is captured.
github-slugger drops Join_Control, so it differs from GitHub on ZWNJ and ZWJ. That is why this follows GitHub and adds no dependency.
Generated with Gemini 4 Neon in T3 Code Nightly
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
coderabbitai
Bot
commented
Nov 27, 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
-
githubHeadingSlug changes the Unicode characters it retains. Tests check the resulting slugs for superscript, a variation selector, and a Persian zero-width non-joiner.
Changes: Unicode heading slug handling
| Layer / File(s) |
Summary |
Slug character rules and test coverage apps/web/src/components/chat/markdownFragments.ts, apps/web/src/components/chat/markdownFragments.test.ts |
githubHeadingSlug now retains Unicode alphabetic, mark, decimal digit, connector punctuation, and join control characters, plus spaces and hyphens. Tests check slug output for three Unicode headings. |
Estimated code review effort: 2 (Simple) | ~10 minutes
Change: Bug fix
Suggested reviewers: juliusmarminge
Merge Risk: Minimal · up to 0b83a
-
This change updates heading anchor generation so GitHub-style links work for headings containing symbols such as superscripts and zero-width joiners. The change is small and tested, and I found no merge-blocking risk.
Pre-merge checks: 4
-
| Check name |
Status |
Explanation |
| Title check |
 |
The title names the main change: heading ids in the web app now match GitHub's anchors for superscript, circled-number, and Persian (ZWNJ) text. It is specific and relates to the githubHeadingSlug reg… |
| Description check |
 |
The description follows the template. It has Problem, Change, Scope, and Verification sections. The Problem section gives the expected behavior and reproduction steps. The Change section explains the … |
| 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: heading ids in the web app now match GitHub's anchors for superscript, circled-number, and Persian (ZWNJ) text. It is specific and relates to the githubHeadingSlug regex change. The title is 70 characters, which is slightly long but acceptable, and it follows the conventional commit format.
Full details: Description check
-
Explanation
The description follows the template. It has Problem, Change, Scope, and Verification sections. The Problem section gives the expected behavior and reproduction steps. The Change section explains the regex fix and why it matches GitHub's behavior. The Scope section explains why no issue is linked, which the template allows for small obvious bugs. The Verification section lists the setup, steps, before/after screenshots, a GitHub comparison, and test results, and it states what was not shown. The model and harness are named at the end, as the template asks. The screenshots are external links, which the template permits.
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 285110c and 0b83a38.
Files selected for processing: 1
-
apps/web/src/components/chat/markdownFragments.test.ts
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 5 remain after this review.
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
Evidence
Real web app, Chromium, 1440x900, light theme, fresh synthetic state on both commits. Opened a small anchors.md in Files > rendered Markdown, then clicked Plain, Area, Step and Persian, returning to the top between clicks. Plain worked on both. All three Unicode links failed on base and scrolled to their headings on head. Every click preserved the thread URL. scenarios:prove exited 0.
Scenario source and synthetic fixture
Not shown:
- Other alphabetic symbols were not exercised; this proof covers superscript two, circled one and Persian U+200C.
- The separate large-file virtualization limitation was not exercised; the fixture deliberately keeps every heading mounted.
|
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:unvouched
Author is not yet trusted in 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.
|