Skip to content

Commit 530d866

Browse files
Apply review comments
1 parent 8f9014d commit 530d866

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

@@ -166,10 +167,11 @@ pub fn render<T: Print, S: Print>(
166167
themes = themes.iter()
167168
.filter_map(|t| t.file_stem())
168169
.filter_map(|t| t.to_str())
169-
.map(|t| format!(r#"<link rel="stylesheet" type="text/css" href="{}{}{}.css">"#,
170-
static_root_path,
171-
t,
172-
page.resource_suffix))
170+
.map(|t| format!(r#"<link rel="stylesheet" type="text/css" href="{}.css">"#,
171+
Escape(&format!("{}{}{}",
172+
static_root_path,
173+
t,
174+
page.resource_suffix))))
173175
.collect::<String>(),
174176
suffix=page.resource_suffix,
175177
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
@@ -569,9 +569,7 @@ fn write_shared(
569569
let content = try_err!(fs::read(&entry), &entry);
570570
let theme = try_none!(try_none!(entry.file_stem(), &entry).to_str(), &entry);
571571
let extension = try_none!(try_none!(entry.extension(), &entry).to_str(), &entry);
572-
cx.shared.fs.write(
573-
cx.path(&format!("{}.{}", Escape(theme), extension)),
574-
content.as_slice())?;
572+
cx.shared.fs.write(cx.path(&format!("{}.{}", theme, extension)), content.as_slice())?;
575573
themes.insert(theme.to_owned());
576574
}
577575

@@ -637,7 +635,7 @@ themePicker.onclick = switchThemeButtonState;
637635
themePicker.onblur = handleThemeButtonsBlur;
638636
{}.forEach(function(item) {{
639637
var but = document.createElement('button');
640-
but.innerHTML = item;
638+
but.textContent = item;
641639
but.onclick = function(el) {{
642640
switchTheme(currentTheme, mainTheme, item, true);
643641
}};

0 commit comments

Comments
 (0)