File tree 2 files changed +11
-1
lines changed
src/librustdoc/html/static/js
2 files changed +11
-1
lines changed Original file line number Diff line number Diff line change @@ -279,7 +279,8 @@ function preLoadCss(cssUrl) {
279
279
const params = { } ;
280
280
window . location . search . substring ( 1 ) . split ( "&" ) .
281
281
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, " " ) ) ;
283
284
params [ decodeURIComponent ( pair [ 0 ] ) ] =
284
285
typeof pair [ 1 ] === "undefined" ? null : decodeURIComponent ( pair [ 1 ] ) ;
285
286
} ) ;
Original file line number Diff line number Diff line change @@ -137,3 +137,12 @@ call-function: (
137
137
"menu_a_color": "#3873ad",
138
138
}
139
139
)
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