Skip to content

Commit 4d0363f

Browse files
committed
fix: enhance sidebar navigation link selection for decoded URLs
1 parent c8f93ff commit 4d0363f

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/core/render/index.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -315,8 +315,11 @@ export function Render(Base) {
315315
sidebarToggleEl.setAttribute('aria-expanded', String(!isMobile()));
316316

317317
const activeElmHref = this.router.toURL(this.route.path);
318+
const decodedHref = decodeURIComponent(activeElmHref);
318319
const activeEl = /** @type {HTMLElement | null} */ (
319-
dom.find(`.sidebar-nav a[href="${activeElmHref}"]`)
320+
dom.find(
321+
`.sidebar-nav a[href="${activeElmHref}"]${activeElmHref !== decodedHref ? `, .sidebar-nav a[href="${decodedHref}"]` : ''}`,
322+
)
320323
);
321324

322325
this.#addTextAsTitleAttribute('.sidebar-nav a');

0 commit comments

Comments
 (0)