about summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
authorGuillaume Gomez <guillaume1.gomez@gmail.com>2019-10-10 12:09:01 +0200
committerGuillaume Gomez <guillaume1.gomez@gmail.com>2019-11-18 16:43:48 +0100
commit530d866aef047fa0f20a655676fd0b3ff4cbf86b (patch)
tree4ea67a6ed746ad68f458de5e8060f0e91f0c12b2 /src
parent8f9014d98f88c57dbd786a3b9ac86c5bfcdcb401 (diff)
downloadrust-530d866aef047fa0f20a655676fd0b3ff4cbf86b.tar.gz
rust-530d866aef047fa0f20a655676fd0b3ff4cbf86b.zip
Apply review comments
Diffstat (limited to 'src')
-rw-r--r--src/doc/rustdoc/src/command-line-arguments.md2
-rw-r--r--src/librustdoc/html/layout.rs10
-rw-r--r--src/librustdoc/html/render.rs6
3 files changed, 9 insertions, 9 deletions
diff --git a/src/doc/rustdoc/src/command-line-arguments.md b/src/doc/rustdoc/src/command-line-arguments.md
index c935699abb0..40bd6f43c61 100644
--- a/src/doc/rustdoc/src/command-line-arguments.md
+++ b/src/doc/rustdoc/src/command-line-arguments.md
@@ -374,7 +374,7 @@ Note that the theme's name will be the file name without its extension. So if yo
 ### `check-theme`: check if your themes implement all the required rules
 
 This flag allows you to check if your themes implement the necessary CSS rules. To put it more
-simply, when adding a new theme, it needs to implements all the CSS rules present in the "light"
+simply, when adding a new theme, it needs to implement all the CSS rules present in the "light"
 CSS theme.
 
 You can use this flag like this:
diff --git a/src/librustdoc/html/layout.rs b/src/librustdoc/html/layout.rs
index 697dee0216e..8249e69e9a7 100644
--- a/src/librustdoc/html/layout.rs
+++ b/src/librustdoc/html/layout.rs
@@ -1,6 +1,7 @@
 use std::path::PathBuf;
 
 use crate::externalfiles::ExternalHtml;
+use crate::html::escape::Escape;
 use crate::html::render::ensure_trailing_slash;
 use crate::html::format::{Buffer, Print};
 
@@ -166,10 +167,11 @@ pub fn render<T: Print, S: Print>(
     themes = themes.iter()
                    .filter_map(|t| t.file_stem())
                    .filter_map(|t| t.to_str())
-                   .map(|t| format!(r#"<link rel="stylesheet" type="text/css" href="{}{}{}.css">"#,
-                                    static_root_path,
-                                    t,
-                                    page.resource_suffix))
+                   .map(|t| format!(r#"<link rel="stylesheet" type="text/css" href="{}.css">"#,
+                                    Escape(&format!("{}{}{}",
+                                                    static_root_path,
+                                                    t,
+                                                    page.resource_suffix))))
                    .collect::<String>(),
     suffix=page.resource_suffix,
     static_extra_scripts=page.static_extra_scripts.iter().map(|e| {
diff --git a/src/librustdoc/html/render.rs b/src/librustdoc/html/render.rs
index dda4b024bce..1207c5e3bc5 100644
--- a/src/librustdoc/html/render.rs
+++ b/src/librustdoc/html/render.rs
@@ -569,9 +569,7 @@ fn write_shared(
         let content = try_err!(fs::read(&entry), &entry);
         let theme = try_none!(try_none!(entry.file_stem(), &entry).to_str(), &entry);
         let extension = try_none!(try_none!(entry.extension(), &entry).to_str(), &entry);
-        cx.shared.fs.write(
-            cx.path(&format!("{}.{}", Escape(theme), extension)),
-            content.as_slice())?;
+        cx.shared.fs.write(cx.path(&format!("{}.{}", theme, extension)), content.as_slice())?;
         themes.insert(theme.to_owned());
     }
 
@@ -637,7 +635,7 @@ themePicker.onclick = switchThemeButtonState;
 themePicker.onblur = handleThemeButtonsBlur;
 {}.forEach(function(item) {{
     var but = document.createElement('button');
-    but.innerHTML = item;
+    but.textContent = item;
     but.onclick = function(el) {{
         switchTheme(currentTheme, mainTheme, item, true);
     }};