Escape search-index item descriptions
The item descriptions are included verbatim in search results causing certain character sequences to misbehave.
This commit is contained in:
parent
a94642c6f5
commit
dcb352647b
1 changed files with 2 additions and 2 deletions
|
@ -554,7 +554,7 @@ fn build_index(krate: &clean::Crate, cache: &mut Cache) -> String {
|
||||||
ty: shortty(item),
|
ty: shortty(item),
|
||||||
name: item.name.clone().unwrap(),
|
name: item.name.clone().unwrap(),
|
||||||
path: fqp[..fqp.len() - 1].join("::"),
|
path: fqp[..fqp.len() - 1].join("::"),
|
||||||
desc: shorter(item.doc_value()),
|
desc: Escape(&shorter(item.doc_value())).to_string(),
|
||||||
parent: Some(did),
|
parent: Some(did),
|
||||||
search_type: get_index_search_type(&item, parent_basename),
|
search_type: get_index_search_type(&item, parent_basename),
|
||||||
});
|
});
|
||||||
|
@ -1065,7 +1065,7 @@ impl DocFolder for Cache {
|
||||||
ty: shortty(&item),
|
ty: shortty(&item),
|
||||||
name: s.to_string(),
|
name: s.to_string(),
|
||||||
path: path.join("::").to_string(),
|
path: path.join("::").to_string(),
|
||||||
desc: shorter(item.doc_value()),
|
desc: Escape(&shorter(item.doc_value())).to_string(),
|
||||||
parent: parent,
|
parent: parent,
|
||||||
search_type: get_index_search_type(&item, parent_basename),
|
search_type: get_index_search_type(&item, parent_basename),
|
||||||
});
|
});
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue