Skip to content

Comments

fix: decode HTML entities in TOC dropdown labels#1550

Merged
danielroe merged 2 commits intonpmx-dev:mainfrom
andrii-bodnar:fix/readme-toc-dropdown
Feb 22, 2026
Merged

fix: decode HTML entities in TOC dropdown labels#1550
danielroe merged 2 commits intonpmx-dev:mainfrom
andrii-bodnar:fix/readme-toc-dropdown

Conversation

@andrii-bodnar
Copy link
Contributor

Hello, and thank you for creating such a great tool. It's now my go-to way of exploring NPM packages!

I noticed a small bug in the ToC dropdown. It shows &amp; for headings that containes & (and similarly for other HTML entities like <, ", etc.).

For example: https://npmx.dev/package/@lingui/core#readme
1

The dropdown displays the Installation &amp; Usage option instead of Installation & Usage.

In this PR, I added HTML entities decoding when rendering TOC labels in ReadmeTocDropdown using the existing decodeHtmlEntities function from the formatters. Server-side decoding was tried but didn’t resolve the issue, so decoding is done in the component.

2

Please let me know if this is the right fix.

@vercel
Copy link

vercel bot commented Feb 20, 2026

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

Project Deployment Actions Updated (UTC)
docs.npmx.dev Ready Ready Preview, Comment Feb 22, 2026 8:08am
npmx.dev Ready Ready Preview, Comment Feb 22, 2026 8:08am
1 Skipped Deployment
Project Deployment Actions Updated (UTC)
npmx-lunaria Ignored Ignored Feb 22, 2026 8:08am

Request Review

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Feb 20, 2026

No actionable comments were generated in the recent review. 🎉


📝 Walkthrough

Walkthrough

The ReadmeTocDropdown.vue component has been updated to decode HTML entities in text rendering. An import for the decodeHtmlEntities utility function was added, and the component's template now applies this function to text values across the table of contents dropdown items at multiple nesting levels. The change is limited to text transformation with no modifications to component logic, control flow, or event handling.

Suggested reviewers

  • danielroe
🚥 Pre-merge checks | ✅ 1
✅ Passed checks (1 passed)
Check name Status Explanation
Description check ✅ Passed The pull request description clearly explains a specific bug (HTML entities displaying incorrectly in ToC dropdown) and describes the implemented fix with supporting screenshots.

✏️ 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

Tip

Issue Planner is now in beta. Read the docs and try it out! Share your feedback on Discord.


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.

❤️ Share

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

@codecov
Copy link

codecov bot commented Feb 22, 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!

@danielroe danielroe changed the title fix(readme): decode HTML entities in TOC dropdown labels fix: decode HTML entities in TOC dropdown labels Feb 22, 2026
@danielroe danielroe added this pull request to the merge queue Feb 22, 2026
Merged via the queue into npmx-dev:main with commit f239c39 Feb 22, 2026
17 of 18 checks passed
@github-actions
Copy link

Thanks for your first contribution, @andrii-bodnar! 👏

We'd love to welcome you to the npmx community. Come and say hi on Discord! And once you've joined, visit npmx.wamellow.com to claim the contributor role.

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.

3 participants