Update crates/mdbook-html/front-end/searcher/searcher.js

Co-authored-by: Eric Huss <eric@huss.org>
This commit is contained in:
tonywu6 2026-05-06 22:56:25 +08:00 committed by GitHub
parent 3a16879dda
commit b4e674877f
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -343,9 +343,7 @@ window.search = window.search || {};
} }
// also removes the `?URL_MARK_PARAM=` search param so that // also removes the `?URL_MARK_PARAM=` search param so that
// in-page navigation doesn't make highlights unexpectedly appear again // in-page navigation doesn't make highlights unexpectedly appear again
const url = new URL(window.location.href); setSearchUrlParameters('', 'replace');
url.searchParams.delete(URL_MARK_PARAM);
history.replaceState(null, '', url);
}; };
for (let i = 0; i < markers.length; i++) { for (let i = 0; i < markers.length; i++) {