summary refs log tree commit diff
path: root/src/librustdoc/html/render.rs
diff options
context:
space:
mode:
authorkennytm <kennytm@gmail.com>2017-12-22 02:50:52 +0800
committerGitHub <noreply@github.com>2017-12-22 02:50:52 +0800
commit256bf2be62cd1d124fbfe6c6a0fb9c43f4cb3e91 (patch)
tree5c365824158db0b5161523226c0f00d475686709 /src/librustdoc/html/render.rs
parent614e285fa944dda3e147bb2b3f0d706ff10f7e4f (diff)
parentd4424d84fbe442fbf0dbad43ca1862544a6a5ec5 (diff)
downloadrust-256bf2be62cd1d124fbfe6c6a0fb9c43f4cb3e91.tar.gz
rust-256bf2be62cd1d124fbfe6c6a0fb9c43f4cb3e91.zip
Rollup merge of #46847 - GuillaumeGomez:more-sidebar-escape, r=QuietMisdreavus
Escape more items in the sidebar when needed

Fixes #46724.

r? @QuietMisdreavus
Diffstat (limited to 'src/librustdoc/html/render.rs')
-rw-r--r--src/librustdoc/html/render.rs7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/librustdoc/html/render.rs b/src/librustdoc/html/render.rs
index 9f981e97a76..fd6865469df 100644
--- a/src/librustdoc/html/render.rs
+++ b/src/librustdoc/html/render.rs
@@ -3718,9 +3718,10 @@ fn sidebar_assoc_items(it: &clean::Item) -> String {
                     })).and_then(|did| c.impls.get(&did));
                     if let Some(impls) = inner_impl {
                         out.push_str("<a class=\"sidebar-title\" href=\"#deref-methods\">");
-                        out.push_str(&format!("Methods from {:#}&lt;Target={:#}&gt;",
-                                              impl_.inner_impl().trait_.as_ref().unwrap(),
-                                              target));
+                        out.push_str(&format!("Methods from {}&lt;Target={}&gt;",
+                                              Escape(&format!("{:#}",
+                                                     impl_.inner_impl().trait_.as_ref().unwrap())),
+                                              Escape(&format!("{:#}", target))));
                         out.push_str("</a>");
                         let ret = impls.iter()
                                        .filter(|i| i.inner_impl().trait_.is_none())