about summary refs log tree commit diff
path: root/src/test
diff options
context:
space:
mode:
authorOliver Middleton <olliemail27@gmail.com>2020-02-29 23:39:26 +0000
committerOliver Middleton <olliemail27@gmail.com>2020-03-01 00:15:44 +0000
commit3c97f8ad12e38fb658a88bf9c0c72446987f2021 (patch)
tree1540c510c00aa96404f66d0acd19804cc323d260 /src/test
parent3eeefc21f1a3ed9755c072c83808ed5c087b8c9a (diff)
downloadrust-3c97f8ad12e38fb658a88bf9c0c72446987f2021.tar.gz
rust-3c97f8ad12e38fb658a88bf9c0c72446987f2021.zip
rustdoc: HTML escape crate version
As `--crate-version` accepts arbitrary strings they need to be escaped.
Diffstat (limited to 'src/test')
-rw-r--r--src/test/rustdoc/crate-version-escape.rs6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/test/rustdoc/crate-version-escape.rs b/src/test/rustdoc/crate-version-escape.rs
new file mode 100644
index 00000000000..2f91eea339b
--- /dev/null
+++ b/src/test/rustdoc/crate-version-escape.rs
@@ -0,0 +1,6 @@
+// compile-flags: --crate-version=<script>alert("hi")</script> -Z unstable-options
+
+#![crate_name = "foo"]
+
+// @has 'foo/index.html' '//div[@class="block version"]/p' 'Version <script>alert("hi")</script>'
+// @has 'foo/all.html' '//div[@class="block version"]/p' 'Version <script>alert("hi")</script>'