about summary refs log tree commit diff
path: root/src/librustdoc/html
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/librustdoc/html
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/librustdoc/html')
-rw-r--r--src/librustdoc/html/render.rs5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/librustdoc/html/render.rs b/src/librustdoc/html/render.rs
index 6a23b230e12..92db95eae32 100644
--- a/src/librustdoc/html/render.rs
+++ b/src/librustdoc/html/render.rs
@@ -1313,7 +1313,8 @@ impl Context {
                          <p>Version {}</p>\
                      </div>\
                      <a id='all-types' href='index.html'><p>Back to index</p></a>",
-                crate_name, version
+                crate_name,
+                Escape(version),
             )
         } else {
             String::new()
@@ -3974,7 +3975,7 @@ fn print_sidebar(cx: &Context, it: &clean::Item, buffer: &mut Buffer) {
                 "<div class='block version'>\
                     <p>Version {}</p>\
                     </div>",
-                version
+                Escape(version)
             );
         }
     }