1
Fork 0

Rollup merge of #69598 - ollie27:rustdoc_crate-version_escape, r=GuillaumeGomez

rustdoc: HTML escape crate version

As `--crate-version` accepts arbitrary strings they need to be escaped.

r? @GuillaumeGomez
This commit is contained in:
Dylan DPC 2020-03-01 17:23:34 +01:00 committed by GitHub
commit 22a03913f4
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 9 additions and 2 deletions

View file

@ -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)
);
}
}