Skip to content

Commit c614cad

Browse files
Apply review comments
1 parent 94b21eb commit c614cad

File tree

3 files changed

+9
-9
lines changed

3 files changed

+9
-9
lines changed

src/doc/rustdoc/src/command-line-arguments.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -374,7 +374,7 @@ Note that the theme's name will be the file name without its extension. So if yo
374374
### `check-theme`: check if your themes implement all the required rules
375375

376376
This flag allows you to check if your themes implement the necessary CSS rules. To put it more
377-
simply, when adding a new theme, it needs to implements all the CSS rules present in the "light"
377+
simply, when adding a new theme, it needs to implement all the CSS rules present in the "light"
378378
CSS theme.
379379

380380
You can use this flag like this:

src/librustdoc/html/layout.rs

+6-4
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
use std::path::PathBuf;
22

33
use crate::externalfiles::ExternalHtml;
4+
use crate::html::escape::Escape;
45
use crate::html::render::ensure_trailing_slash;
56
use crate::html::format::{Buffer, Print};
67

@@ -213,10 +214,11 @@ pub fn render<T: Print, S: Print>(
213214
themes = themes.iter()
214215
.filter_map(|t| t.file_stem())
215216
.filter_map(|t| t.to_str())
216-
.map(|t| format!(r#"<link rel="stylesheet" type="text/css" href="{}{}{}.css">"#,
217-
static_root_path,
218-
t,
219-
page.resource_suffix))
217+
.map(|t| format!(r#"<link rel="stylesheet" type="text/css" href="{}.css">"#,
218+
Escape(&format!("{}{}{}",
219+
static_root_path,
220+
t,
221+
page.resource_suffix))))
220222
.collect::<String>(),
221223
suffix=page.resource_suffix,
222224
static_extra_scripts=page.static_extra_scripts.iter().map(|e| {

src/librustdoc/html/render.rs

+2-4
Original file line numberDiff line numberDiff line change
@@ -568,9 +568,7 @@ fn write_shared(
568568
let content = try_err!(fs::read(&entry), &entry);
569569
let theme = try_none!(try_none!(entry.file_stem(), &entry).to_str(), &entry);
570570
let extension = try_none!(try_none!(entry.extension(), &entry).to_str(), &entry);
571-
cx.shared.fs.write(
572-
cx.path(&format!("{}.{}", Escape(theme), extension)),
573-
content.as_slice())?;
571+
cx.shared.fs.write(cx.path(&format!("{}.{}", theme, extension)), content.as_slice())?;
574572
themes.insert(theme.to_owned());
575573
}
576574

@@ -636,7 +634,7 @@ themePicker.onclick = switchThemeButtonState;
636634
themePicker.onblur = handleThemeButtonsBlur;
637635
{}.forEach(function(item) {{
638636
var but = document.createElement('button');
639-
but.innerHTML = item;
637+
but.textContent = item;
640638
but.onclick = function(el) {{
641639
switchTheme(currentTheme, mainTheme, item, true);
642640
}};

0 commit comments

Comments
 (0)