Skip to content

Commit

Permalink
chore(syntax-highlight): support -nolint suffix for all languages (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
queengooborg authored Feb 7, 2023
1 parent 58b9b4a commit ca42266
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions build/syntax-highlight.ts
Original file line number Diff line number Diff line change
Expand Up @@ -61,9 +61,6 @@ const loadAllLanguages = lazy(() => {
// because Prism is an implementation detail.
const ALIASES = new Map([
// ["idl", "webidl"], // block list
["css-nolint", "css"],
["html-nolint", "html"],
["js-nolint", "js"],
["sh", "shell"],
]);

Expand Down Expand Up @@ -96,7 +93,10 @@ export function syntaxHighlight($, doc) {
if (!match) {
return;
}
const name = ALIASES.get(match[1]) || match[1];
let name = match[1].replace("-nolint", "");
if (ALIASES.has(name)) {
name = ALIASES.get(name);
}
if (IGNORE.has(name)) {
// Seems to exist a couple of these in our docs. Just bail.
return;
Expand Down

0 comments on commit ca42266

Please sign in to comment.