File tree Expand file tree Collapse file tree 2 files changed +8
-2
lines changed
sphinx/themes/basic/static Expand file tree Collapse file tree 2 files changed +8
-2
lines changed Original file line number Diff line number Diff line change @@ -148,6 +148,8 @@ Bugs fixed
148148* #14059: LaTeX: Footnotes cause pdflatex error with French language
149149 (since late June 2025 upstream change to LaTeX ``babel-french ``).
150150 Patch by Jean-François B.
151+ * #13916: HTML Search: do not clear text fragments from the URL on page load.
152+ Patch by Harmen Stoppels.
151153
152154
153155Testing
Original file line number Diff line number Diff line change @@ -80,8 +80,12 @@ const SphinxHighlight = {
8080 || url . searchParams . get ( "highlight" )
8181 || "" ;
8282 localStorage . removeItem ( "sphinx_highlight_terms" ) ;
83- url . searchParams . delete ( "highlight" ) ;
84- window . history . replaceState ( { } , "" , url ) ;
83+ // Update history only if '?highlight' is present; otherwise it
84+ // clears text fragments (not set in window.location by the browser)
85+ if ( url . searchParams . has ( "highlight" ) ) {
86+ url . searchParams . delete ( "highlight" ) ;
87+ window . history . replaceState ( { } , "" , url ) ;
88+ }
8589
8690 // get individual terms from highlight string
8791 const terms = highlight
You can’t perform that action at this time.
0 commit comments