about summary refs log tree commit diff
diff options
context:
space:
mode:
authorGuillaume Gomez <guillaume.gomez@huawei.com>2023-06-13 10:50:16 +0200
committerGuillaume Gomez <guillaume.gomez@huawei.com>2023-06-14 14:22:17 +0200
commit4f0a9124bdfb84e71bde8e9d0b79d688baf7887f (patch)
tree18b9ee4b2ae533ed41ea458741cea1cc0a8aa55e
parentd1a76a9f50f55f88e6dd03f9a9ba64a02bc1f985 (diff)
downloadrust-4f0a9124bdfb84e71bde8e9d0b79d688baf7887f.tar.gz
rust-4f0a9124bdfb84e71bde8e9d0b79d688baf7887f.zip
Correctly display whitespace characters in search error
-rw-r--r--src/librustdoc/html/static/js/search.js2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/librustdoc/html/static/js/search.js b/src/librustdoc/html/static/js/search.js
index d421adb13cb..35abce0903c 100644
--- a/src/librustdoc/html/static/js/search.js
+++ b/src/librustdoc/html/static/js/search.js
@@ -2192,7 +2192,7 @@ function initSearch(rawSearchIndex) {
             error.forEach((value, index) => {
                 value = value.split("<").join("&lt;").split(">").join("&gt;");
                 if (index % 2 !== 0) {
-                    error[index] = `<code>${value}</code>`;
+                    error[index] = `<code>${value.replaceAll(" ", "&nbsp;")}</code>`;
                 } else {
                     error[index] = value;
                 }