Skip to content

Commit 4f0a912

Browse files
Correctly display whitespace characters in search error
1 parent d1a76a9 commit 4f0a912

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/librustdoc/html/static/js/search.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -2192,7 +2192,7 @@ function initSearch(rawSearchIndex) {
21922192
error.forEach((value, index) => {
21932193
value = value.split("<").join("&lt;").split(">").join("&gt;");
21942194
if (index % 2 !== 0) {
2195-
error[index] = `<code>${value}</code>`;
2195+
error[index] = `<code>${value.replaceAll(" ", "&nbsp;")}</code>`;
21962196
} else {
21972197
error[index] = value;
21982198
}

0 commit comments

Comments
 (0)