fix(legacy-html): prevent partial nav class matches#762
fix(legacy-html): prevent partial nav class matches#762moshams272 wants to merge 1 commit intonodejs:mainfrom
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
PR SummaryLow Risk Overview Reviewed by Cursor Bugbot for commit b0ddc10. Bugbot is set up for automated code reviews on this repo. Configure here. |
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #762 +/- ##
=======================================
Coverage 78.43% 78.43%
=======================================
Files 157 157
Lines 13963 13963
Branches 1152 1152
=======================================
Hits 10952 10952
Misses 3006 3006
Partials 5 5 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
ovflowd
left a comment
There was a problem hiding this comment.
Nice, can you verify this doesn't break existing scenarios?

Description
The previous
.replace()logic used a partial match (class="nav-${head.api}). For APIs likestream, the partial stringclass="nav-streamwould incorrectly match the first occurrence it found, which happens to beclass="nav-stream_iter". This resulted in corrupted class namesclass="active_iter nav-stream"and left the actualstreamlink unmodified:The same for
Modules: node:module API:The Fix:
Added closing double-quotes to the search and replace strings to enforce an exact match (
class="nav-${head.api}").Validation
legacy-htmldocs locally.StreamandModules: node:module APIsidebar links are now correctly bolded (activeclass applied).Related Issues
#761
Check List
node --run testand all tests passed.node --run format&node --run lint.