doctools: fix hideSearchWords

Previous code was:

b3812f72a9/sphinx/themes/basic/static/doctools.js (L262-L268)

Ref https://github.com/sphinx-doc/sphinx/pull/10028
This commit is contained in:
Santos Gallegos
2022-03-07 11:44:17 -05:00
parent ee298ac47e
commit be1bc680e7

View File

@@ -168,7 +168,8 @@ const Documentation = {
document
.querySelectorAll("span.highlighted")
.forEach((el) => el.classList.remove("highlighted"));
new URLSearchParams(window.location.search).delete('highlight')
const url = new URL(window.location);
url.searchParams.delete('highlight');
window.history.replaceState({}, '', url);
},