about summary refs log tree commit diff
path: root/src/test
diff options
context:
space:
mode:
authorYuki Okushi <jtitor@2k36.org>2021-06-08 13:26:35 +0900
committerGitHub <noreply@github.com>2021-06-08 13:26:35 +0900
commitf99a892e6dabffc73fa26cde10ce7e54a252e660 (patch)
treec98e226caa7e1ecae1299564c0717066a0aefe86 /src/test
parente062121f036e632a2d4a698270dbf3accae919ee (diff)
parent314ef592e284b16d4cb1764cec79cd5f0e0d0171 (diff)
downloadrust-f99a892e6dabffc73fa26cde10ce7e54a252e660.tar.gz
rust-f99a892e6dabffc73fa26cde10ce7e54a252e660.zip
Rollup merge of #86095 - GuillaumeGomez:search-description-codeblock, r=jsha
Search description codeblock

The codeblocks are not displayed correctly:

![Screenshot from 2021-06-07 11-11-53](https://user-images.githubusercontent.com/3050060/120991915-5fb05680-c782-11eb-9b32-973a64b1f631.png)

This PR interprets the HTML correctly (and still prevent invalid HTML because of how it inserts it):

![Screenshot from 2021-06-07 11-12-00](https://user-images.githubusercontent.com/3050060/120991919-6048ed00-c782-11eb-8ac5-c3aa6508bc8b.png)

r? ```@jsha```
Diffstat (limited to 'src/test')
-rw-r--r--src/test/rustdoc-gui/search-result-description.goml5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/test/rustdoc-gui/search-result-description.goml b/src/test/rustdoc-gui/search-result-description.goml
new file mode 100644
index 00000000000..a50d03cf489
--- /dev/null
+++ b/src/test/rustdoc-gui/search-result-description.goml
@@ -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!")