From 46b4a3b83148192fa4dc50bf1a751357ec7393aa Mon Sep 17 00:00:00 2001 From: Michael Howell Date: Mon, 12 Dec 2022 15:17:49 -0700 Subject: [PATCH] rustdoc: remove `type="text/css" from stylesheet links MDN directly recommends this in , since "CSS is the only stylesheet language used on the web." Like 07a243b2a46384235d7e2c08688978b7cf018973, but a few places that were missed the first time. --- src/librustdoc/html/render/context.rs | 2 +- src/librustdoc/html/static/js/main.js | 1 - src/librustdoc/markdown.rs | 2 +- 3 files changed, 2 insertions(+), 3 deletions(-) diff --git a/src/librustdoc/html/render/context.rs b/src/librustdoc/html/render/context.rs index 73690c86f4f..d4d3e4f6ea7 100644 --- a/src/librustdoc/html/render/context.rs +++ b/src/librustdoc/html/render/context.rs @@ -637,7 +637,7 @@ impl<'tcx> FormatRenderer<'tcx> for Context<'tcx> { You need to enable Javascript be able to update your settings.\ \ \ - \ ", static_root_path = page.get_static_root_path(), diff --git a/src/librustdoc/html/static/js/main.js b/src/librustdoc/html/static/js/main.js index 152116089c7..3f97e4e2e39 100644 --- a/src/librustdoc/html/static/js/main.js +++ b/src/librustdoc/html/static/js/main.js @@ -184,7 +184,6 @@ function browserSupportsHistoryApi() { function loadCss(cssUrl) { const link = document.createElement("link"); link.href = cssUrl; - link.type = "text/css"; link.rel = "stylesheet"; document.getElementsByTagName("head")[0].appendChild(link); } diff --git a/src/librustdoc/markdown.rs b/src/librustdoc/markdown.rs index 044e051440c..5f4ad6d2aea 100644 --- a/src/librustdoc/markdown.rs +++ b/src/librustdoc/markdown.rs @@ -53,7 +53,7 @@ pub(crate) fn render>( let mut css = String::new(); for name in &options.markdown_css { - write!(css, r#""#) + write!(css, r#""#) .expect("Writing to a String can't fail"); }