GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

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

@only21mil

@only21mil only21mil commented Nov 27, 2026

Copy link
Copy Markdown
Contributor

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)
Before: clicking the link leaves the preview at the top After: the preview scrolls to the Area of r² heading

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.

All reactions
@only21mil
fix(web): heading ids match GitHub's anchors for ², ① and Persian text
285110c
@github-actions github-actions Bot added vouch:unvouched Author is not yet trusted in the VOUCHED list. size:XS 0-9 changed lines (additions + deletions). labels Nov 27, 2026
@coderabbitai

coderabbitai Bot commented Nov 27, 2026 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Contributor

Explain Change →

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: Passed 4

Check name Status Explanation
Title check Passed 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 Passed 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 Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed 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)

  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Recent review info

Run configuration

  • Source mode: Auto
  • Repository: pingdotgg/t3code
  • Branch: main
  • File: .coderabbit.config.ts
  • Commit: 3788bd3
  • Layers: Repository TS config
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 032bc373-8f68-4fae-ad95-48e012765649
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.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@juliusmarminge juliusmarminge added the takeover:in-progress A takeover lead is working on this PR label Nov 27, 2026
juliusmarminge and others added 2 commits November 27, 2026 22:07
@juliusmarminge
Merge remote-tracking branch 'origin/main' into fix/web-github-headin…
0f78087
…g-slug-unicode-compat
@juliusmarminge @claude
test(web): keep only heading slug cases that fail on main
0b83a38
Co-Authored-By: Claude Opus 5.5 <[email protected]>
@juliusmarminge

juliusmarminge commented Nov 27, 2026

Copy link
Copy Markdown
Member

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.

Interaction Before After
Commit 3788bd3d64 0b83a38a88
Area Before: Area stays at top After: Area heading reached
Step Before: Step stays at top After: Step heading reached
Persian Before: Persian stays at top After: Persian heading reached
Recording Before interaction After interaction

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.
All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@juliusmarminge juliusmarminge added takeover:ready Takeover done; auto-lands when gates pass and removed takeover:in-progress A takeover lead is working on this PR labels Nov 27, 2026
@juliusmarminge
juliusmarminge merged commit d0f148b into pingdotgg:main Nov 27, 2026
56 checks passed

Uh oh!

There was an error while loading. Please reload this page.

@juliusmarminge juliusmarminge removed the takeover:ready Takeover done; auto-lands when gates pass label Nov 27, 2026
@omegent-app omegent-app Bot mentioned this pull request Nov 28, 2026
Merge upstream main through 0f78747290a1 patroza/t3code#688
Merged
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

No reviews

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.

Projects

None yet

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.

2 participants

@only21mil @juliusmarminge
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.
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.