From 39586204e0d2a74530beefa86da94fa88e68cd7a Mon Sep 17 00:00:00 2001 From: xFrednet Date: Sat, 26 Jun 2021 13:05:08 +0200 Subject: [PATCH] Removed JS code block language extraction in favor of a rust implementation `rust-clippy#7352` --- .../utils/internal_lints/metadata_collector.rs | 2 +- util/gh-pages/index.html | 16 ++++++---------- 2 files changed, 7 insertions(+), 11 deletions(-) diff --git a/clippy_lints/src/utils/internal_lints/metadata_collector.rs b/clippy_lints/src/utils/internal_lints/metadata_collector.rs index f39c049f2002..5f992e8f3508 100644 --- a/clippy_lints/src/utils/internal_lints/metadata_collector.rs +++ b/clippy_lints/src/utils/internal_lints/metadata_collector.rs @@ -524,7 +524,7 @@ fn extract_attr_docs(cx: &LateContext<'_>, item: &Item<'_>) -> Option { if let Some(stripped_doc) = line.strip_prefix(' ') { docs.push_str(stripped_doc); } else if !line.is_empty() { - docs.push_str(&line); + docs.push_str(line); } } Some(docs) diff --git a/util/gh-pages/index.html b/util/gh-pages/index.html index 4714b8e4317f..6b12474d0735 100644 --- a/util/gh-pages/index.html +++ b/util/gh-pages/index.html @@ -369,16 +369,12 @@

linkify: true, typographer: true, highlight: function (str, lang) { - if (lang) { - // This removes additional markdown information like `,ignore`. - let onlyLang = lang.split(",")[0]; - if (hljs.getLanguage(onlyLang)) { - try { - return '
' +
-                                hljs.highlight(onlyLang, str, true).value +
-                                '
'; - } catch (__) {} - } + if (lang && hljs.getLanguage(docs)) { + try { + return '
' +
+                            hljs.highlight(docs, str, true).value +
+                            '
'; + } catch (__) {} } return '
' + md.utils.escapeHtml(str) + '
';