Skip to content

Comments

fix(readme): decode HTML entities in TOC dropdown labels#1550

Open
andrii-bodnar wants to merge 1 commit intonpmx-dev:mainfrom
andrii-bodnar:fix/readme-toc-dropdown
Open

fix(readme): decode HTML entities in TOC dropdown labels#1550
andrii-bodnar wants to merge 1 commit intonpmx-dev:mainfrom
andrii-bodnar:fix/readme-toc-dropdown

Conversation

@andrii-bodnar
Copy link

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)
npmx.dev Error Error Feb 20, 2026 7:34pm
2 Skipped Deployments
Project Deployment Actions Updated (UTC)
docs.npmx.dev Ignored Ignored Preview Feb 20, 2026 7:34pm
npmx-lunaria Ignored Ignored Feb 20, 2026 7:34pm

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.

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.

1 participant