Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(syntax-highlight): add additional languages #6831

Merged
merged 10 commits into from
Aug 19, 2022
21 changes: 21 additions & 0 deletions build/syntax-highlight.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,16 @@ const lazy = (creator) => {
};

const loadAllLanguages = lazy(() => {
// Some languages are always loaded by Prism, so we can omit them here:
// - Markup (atom, html, markup, mathml, rss, ssml, svg, xml)
// - CSS (css)
// - C-like (clike)
// - JavaScript (javascript, js)
loadLanguages([
"python",
"bash",
"batch",
"powershell",
"sql",
"json",
"glsl",
Expand All @@ -29,6 +35,20 @@ const loadAllLanguages = lazy(() => {
"toml",
"md",
"cs",
"jsx",
"typescript",
"diff",
"ini",
"ignore",
"less",
"regex",
"scss",
"sql",
"uri",
"wasm",
"yaml",
"pug",
// "webidl", // block list
]);
});

Expand All @@ -40,6 +60,7 @@ const loadAllLanguages = lazy(() => {
const ALIASES = new Map([
["sh", "shell"],
["jssyntax", "js"],
// ["idl", "webidl"], // block list
]);

// Over the years we have accumulated some weird <pre> tags whose
Expand Down