Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions CHANGES.rst
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,8 @@ Bugs fixed
* #14059: LaTeX: Footnotes cause pdflatex error with French language
(since late June 2025 upstream change to LaTeX ``babel-french``).
Patch by Jean-François B.
* #13916: HTML Search: do not clear text fragments from the URL on page load.
Patch by Harmen Stoppels.


Testing
Expand Down
8 changes: 6 additions & 2 deletions sphinx/themes/basic/static/sphinx_highlight.js
Original file line number Diff line number Diff line change
Expand Up @@ -80,8 +80,12 @@ const SphinxHighlight = {
|| url.searchParams.get("highlight")
|| "";
localStorage.removeItem("sphinx_highlight_terms");
url.searchParams.delete("highlight");
window.history.replaceState({}, "", url);
// Update history only if '?highlight' is present; otherwise it
// clears text fragments (not set in window.location by the browser)
if (url.searchParams.has("highlight")) {
url.searchParams.delete("highlight");
window.history.replaceState({}, "", url);
}

// get individual terms from highlight string
const terms = highlight
Expand Down
Loading