Rollup merge of #86095 - GuillaumeGomez:search-description-codeblock, r=jsha
Search description codeblock The codeblocks are not displayed correctly:  This PR interprets the HTML correctly (and still prevent invalid HTML because of how it inserts it):  r? ```@jsha```
This commit is contained in:
commit
f99a892e6d
2 changed files with 6 additions and 1 deletions
|
@ -1024,7 +1024,7 @@ window.initSearch = function(rawSearchIndex) {
|
||||||
var description = document.createElement("div");
|
var description = document.createElement("div");
|
||||||
description.className = "desc";
|
description.className = "desc";
|
||||||
var spanDesc = document.createElement("span");
|
var spanDesc = document.createElement("span");
|
||||||
spanDesc.innerText = item.desc + "\u00A0";
|
spanDesc.insertAdjacentHTML("beforeend", item.desc);
|
||||||
|
|
||||||
description.appendChild(spanDesc);
|
description.appendChild(spanDesc);
|
||||||
wrapper.appendChild(description);
|
wrapper.appendChild(description);
|
||||||
|
|
5
src/test/rustdoc-gui/search-result-description.goml
Normal file
5
src/test/rustdoc-gui/search-result-description.goml
Normal file
|
@ -0,0 +1,5 @@
|
||||||
|
// This test is to ensure that the codeblocks are correctly rendered in the search results.
|
||||||
|
goto: file://|DOC_PATH|/test_docs/index.html?search=some_more_function
|
||||||
|
// Waiting for the search results to appear...
|
||||||
|
wait-for: "#titles"
|
||||||
|
assert: (".search-results .desc code", "format!")
|
Loading…
Add table
Add a link
Reference in a new issue