about summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
authormitaa <mitaa.ceb@gmail.com>2016-02-13 11:27:53 +0100
committermitaa <mitaa.ceb@gmail.com>2016-02-13 11:27:53 +0100
commitdcb352647b20f5c7b7a0c1ca42d43ba98a4fa654 (patch)
treebcf092558e175af3a47414372deaae8eed6e2ca6 /src
parenta94642c6f50476cbabbaa27a89ca0fcbf6c89f1a (diff)
downloadrust-dcb352647b20f5c7b7a0c1ca42d43ba98a4fa654.tar.gz
rust-dcb352647b20f5c7b7a0c1ca42d43ba98a4fa654.zip
Escape search-index item descriptions
The item descriptions are included verbatim in search results
causing certain character sequences to misbehave.
Diffstat (limited to 'src')
-rw-r--r--src/librustdoc/html/render.rs4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/librustdoc/html/render.rs b/src/librustdoc/html/render.rs
index 12a17afcc7c..12bb10e348c 100644
--- a/src/librustdoc/html/render.rs
+++ b/src/librustdoc/html/render.rs
@@ -554,7 +554,7 @@ fn build_index(krate: &clean::Crate, cache: &mut Cache) -> String {
                         ty: shortty(item),
                         name: item.name.clone().unwrap(),
                         path: fqp[..fqp.len() - 1].join("::"),
-                        desc: shorter(item.doc_value()),
+                        desc: Escape(&shorter(item.doc_value())).to_string(),
                         parent: Some(did),
                         search_type: get_index_search_type(&item, parent_basename),
                     });
@@ -1065,7 +1065,7 @@ impl DocFolder for Cache {
                             ty: shortty(&item),
                             name: s.to_string(),
                             path: path.join("::").to_string(),
-                            desc: shorter(item.doc_value()),
+                            desc: Escape(&shorter(item.doc_value())).to_string(),
                             parent: parent,
                             search_type: get_index_search_type(&item, parent_basename),
                         });