fix(ui): normalize README heading fragments to lowercase slugs#2385
fix(ui): normalize README heading fragments to lowercase slugs#2385ghostdevv merged 2 commits intonpmx-dev:mainfrom
Conversation
- Decode and slugify in-page README anchors before prefixing - Keep already prefixed `user-content` fragments unchanged - Add coverage for mixed-case heading links
|
The latest updates on your projects. Learn more about Vercel for GitHub.
2 Skipped Deployments
|
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
📝 WalkthroughWalkthroughUpdated README URL fragment handling: added Possibly related PRs
Suggested labels
Suggested reviewers
🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: 6cd493a5-d6ac-4b24-ae7d-6b1ada38dbac
📒 Files selected for processing (2)
server/utils/readme.tstest/unit/server/utils/readme.spec.ts
|
Testing:
|
🔗 Linked issue
resolves #2381
🧭 Context
README heading links on package pages were preserving the original fragment casing, while generated heading ids are lowercased GitHub-style slugs. That meant links like
#Associationsproduced#user-content-Associations, which did not match the rendered heading id#user-content-associations.This change makes README hash links use the same normalization path as generated heading ids.
📚 Description
This updates the README URL resolver to normalize unprefixed hash fragments with the same slugification logic used for heading ids before adding the
user-content-prefix. Already-prefixed fragments are left unchanged so existing customuser-content-*targets still work as-is.A regression test was added to cover mixed-case heading fragments and verify that
#Associationsis rendered as#user-content-associations.