Skip to content

Commit eb9d0b3

Browse files
committed
fix: remove search parameter from route query
1 parent 4f0f6f3 commit eb9d0b3

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

src/core/event/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -478,7 +478,7 @@ export function Events(Base) {
478478
const newActive = dom
479479
.find(
480480
sidebar,
481-
`a[href="${CSS.escape(href)}"], a[href="${CSS.escape(decodeURIComponent(href))}"]`,
481+
`a[href="${href}"], a[href="${decodeURIComponent(href)}"]`,
482482
)
483483
?.closest('li');
484484

src/core/router/history/base.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,10 @@ export class History {
8282
const local = currentRoute && path[0] === '#';
8383
const route = this.parse(replaceSlug(path));
8484

85+
if (route.query.s) {
86+
delete route.query.s;
87+
}
88+
8589
route.query = { ...route.query, ...params };
8690
path = route.path + stringifyQuery(route.query);
8791
path = path.replace(/\.md(\?)|\.md$/, '$1');

0 commit comments

Comments
 (0)