about summary refs log tree commit diff
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2017-03-13 12:44:22 +0000
committerbors <bors@rust-lang.org>2017-03-13 12:44:22 +0000
commita5483a7f36dfb97c2500c0ed4eedc4a665f3f5b1 (patch)
treecc3c46a0ed312f437d4323a364990e04e426adf0
parentddc1708b739dcd9c87b84ec0bc4a997cb2b41634 (diff)
parent19e0505dc76e6cceea48c702d716956b9638eb81 (diff)
downloadrust-a5483a7f36dfb97c2500c0ed4eedc4a665f3f5b1.tar.gz
rust-a5483a7f36dfb97c2500c0ed4eedc4a665f3f5b1.zip
Auto merge of #40451 - ollie27:rustdoc_impls_js_escape, r=GuillaumeGomez
rustdoc: Fix string escaping in implementors js files

The generated HTML can contain quotes so we need to make sure they are
escaped before inserting into the js files.
-rw-r--r--src/librustdoc/html/render.rs2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/librustdoc/html/render.rs b/src/librustdoc/html/render.rs
index 44f71d89529..c571bcb08e4 100644
--- a/src/librustdoc/html/render.rs
+++ b/src/librustdoc/html/render.rs
@@ -763,7 +763,7 @@ fn write_shared(cx: &Context,
             // going on). If they're in different crates then the crate defining
             // the trait will be interested in our implementation.
             if imp.def_id.krate == did.krate { continue }
-            write!(implementors, r#""{}","#, imp.impl_).unwrap();
+            write!(implementors, "{},", as_json(&imp.impl_.to_string())).unwrap();
         }
         implementors.push_str("];");