Skip to content

Comments

fix: convert anchor links in readme content to lowercase#1296

Merged
danielroe merged 1 commit intonpmx-dev:mainfrom
thasmo:readme-lowercase-anchor-links
Feb 9, 2026
Merged

fix: convert anchor links in readme content to lowercase#1296
danielroe merged 1 commit intonpmx-dev:mainfrom
thasmo:readme-lowercase-anchor-links

Conversation

@thasmo
Copy link
Contributor

@thasmo thasmo commented Feb 9, 2026

This fixes #1008 for now, but later we should consider preserving text casing for anchor links for better compatibility.

  • Generated TOC dropdown works
  • Inline TOC works

Examples

@vercel
Copy link

vercel bot commented Feb 9, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
npmx.dev Ready Ready Preview, Comment Feb 9, 2026 8:11pm
2 Skipped Deployments
Project Deployment Actions Updated (UTC)
docs.npmx.dev Ignored Ignored Preview Feb 9, 2026 8:11pm
npmx-lunaria Ignored Ignored Feb 9, 2026 8:11pm

Request Review

@codecov
Copy link

codecov bot commented Feb 9, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ All tests successful. No failed tests found.

📢 Thoughts on this report? Let us know!

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Feb 9, 2026

📝 Walkthrough

Walkthrough

This pull request modifies the readme utility to improve hash link functionality. The change transforms the href attribute of anchor tags to lowercase when the href starts with a hash symbol. This addresses an issue where README hash links do not navigate to their corresponding sections. The modification is minimal, affecting only the link rendering logic whilst preserving all other attributes and link behaviour.

Possibly related PRs

Suggested reviewers

  • danielroe
🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Linked Issues check ✅ Passed The code change converts anchor link hrefs to lowercase, which addresses the root cause of hash links not working due to case-sensitivity mismatches between TOC links and section anchors.
Out of Scope Changes check ✅ Passed The changes are minimal and focused solely on fixing anchor link rendering by converting hash hrefs to lowercase, with no unrelated modifications.
Description check ✅ Passed The pull request description clearly relates to the changeset by explaining the fix for issue #1008 regarding anchor links in README content, including examples and notes about TOC functionality.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

Comment @coderabbitai help to get the list of available commands and usage tips.

@danielroe
Copy link
Member

there may be some other things in #1013 we can pull in too

@danielroe danielroe added this pull request to the merge queue Feb 9, 2026
Merged via the queue into npmx-dev:main with commit dfc2b77 Feb 9, 2026
21 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

README hash links do not work

2 participants