Skip to content

Commit 3958620

Browse files
committed
Removed JS code block language extraction in favor of a rust implementation rust-clippy#7352
1 parent 1feb0d7 commit 3958620

File tree

2 files changed

+7
-11
lines changed

2 files changed

+7
-11
lines changed

clippy_lints/src/utils/internal_lints/metadata_collector.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -524,7 +524,7 @@ fn extract_attr_docs(cx: &LateContext<'_>, item: &Item<'_>) -> Option<String> {
524524
if let Some(stripped_doc) = line.strip_prefix(' ') {
525525
docs.push_str(stripped_doc);
526526
} else if !line.is_empty() {
527-
docs.push_str(&line);
527+
docs.push_str(line);
528528
}
529529
}
530530
Some(docs)

util/gh-pages/index.html

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -369,16 +369,12 @@ <h2 class="panel-title">
369369
linkify: true,
370370
typographer: true,
371371
highlight: function (str, lang) {
372-
if (lang) {
373-
// This removes additional markdown information like `,ignore`.
374-
let onlyLang = lang.split(",")[0];
375-
if (hljs.getLanguage(onlyLang)) {
376-
try {
377-
return '<pre class="hljs"><code>' +
378-
hljs.highlight(onlyLang, str, true).value +
379-
'</code></pre>';
380-
} catch (__) {}
381-
}
372+
if (lang && hljs.getLanguage(docs)) {
373+
try {
374+
return '<pre class="hljs"><code>' +
375+
hljs.highlight(docs, str, true).value +
376+
'</code></pre>';
377+
} catch (__) {}
382378
}
383379

384380
return '<pre class="hljs"><code>' + md.utils.escapeHtml(str) + '</code></pre>';

0 commit comments

Comments
 (0)