MCPcopy Create free account
hub / github.com/nodejs/nodejs.org / resolveLanguage

Function resolveLanguage

packages/rehype-shiki/src/highlighter.mjs:64–75  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

62 * @returns {string}
63 */
64 const resolveLanguage = languageId => {
65 const normalized = languageId?.toLowerCase();
66
67 if (
68 normalized &&
69 (isSpecialLang(normalized) || loadedLanguages.has(normalized))
70 ) {
71 return languageId;
72 }
73
74 return FALLBACK_LANGUAGE;
75 };
76
77 /**
78 * Highlights code and returns the inner HTML inside the <code> tag

Callers 2

highlightToHtmlFunction · 0.85
highlightToHastFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected