This repository was archived by the owner on May 28, 2025. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +11
-1
lines changed
src/librustdoc/html/static/js Expand file tree Collapse file tree 2 files changed +11
-1
lines changed Original file line number Diff line number Diff line change @@ -279,7 +279,8 @@ function preLoadCss(cssUrl) {
279279 const params = { } ;
280280 window . location . search . substring ( 1 ) . split ( "&" ) .
281281 map ( s => {
282- const pair = s . split ( "=" ) ;
282+ // https://github.com/rust-lang/rust/issues/119219
283+ const pair = s . split ( "=" ) . map ( x => x . replace ( / \+ / g, " " ) ) ;
283284 params [ decodeURIComponent ( pair [ 0 ] ) ] =
284285 typeof pair [ 1 ] === "undefined" ? null : decodeURIComponent ( pair [ 1 ] ) ;
285286 } ) ;
Original file line number Diff line number Diff line change @@ -137,3 +137,12 @@ call-function: (
137137 "menu_a_color": "#3873ad",
138138 }
139139)
140+
141+ // Check that search input correctly decodes form encoding.
142+ go-to: "file://" + |DOC_PATH| + "/test_docs/index.html?search=a+b"
143+ wait-for: "#search-tabs" // Waiting for the search.js to load.
144+ assert-property: (".search-input", { "value": "a b" })
145+ // Check that literal + is not treated as space.
146+ go-to: "file://" + |DOC_PATH| + "/test_docs/index.html?search=a%2Bb"
147+ wait-for: "#search-tabs" // Waiting for the search.js to load.
148+ assert-property: (".search-input", { "value": "a+b" })
You can’t perform that action at this time.
0 commit comments