Skip to content

Commit

Permalink
Removed JS code block language extraction in favor of a rust implemen…
Browse files Browse the repository at this point in the history
…tation `rust-clippy#7352`
  • Loading branch information
xFrednet committed Jun 26, 2021
1 parent 1feb0d7 commit 3958620
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -524,7 +524,7 @@ fn extract_attr_docs(cx: &LateContext<'_>, item: &Item<'_>) -> Option<String> {
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)
Expand Down
16 changes: 6 additions & 10 deletions util/gh-pages/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -369,16 +369,12 @@ <h2 class="panel-title">
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 '<pre class="hljs"><code>' +
hljs.highlight(onlyLang, str, true).value +
'</code></pre>';
} catch (__) {}
}
if (lang && hljs.getLanguage(docs)) {
try {
return '<pre class="hljs"><code>' +
hljs.highlight(docs, str, true).value +
'</code></pre>';
} catch (__) {}
}

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

0 comments on commit 3958620

Please sign in to comment.