diff --git a/src/highlight.js b/src/highlight.js index 0f03301a55..6c3e889fba 100644 --- a/src/highlight.js +++ b/src/highlight.js @@ -794,26 +794,6 @@ const HLJS = function(hljs) { return Object.keys(languages); } - /** - intended usage: When one language truly requires another - - Unlike `getLanguage`, this will throw when the requested language - is not available. - - @param {string} name - name of the language to fetch/require - @returns {Language | never} - */ - function requireLanguage(name) { - logger.deprecated("10.4.0", "requireLanguage will be removed entirely in v11."); - logger.deprecated("10.4.0", "Please see https://github.com/highlightjs/highlight.js/pull/2844"); - - const lang = getLanguage(name); - if (lang) { return lang; } - - const err = new Error('The \'{}\' language is required, but not loaded.'.replace('{}', name)); - throw err; - } - /** * @param {string} name - name of the language to retrieve * @returns {Language | undefined} @@ -916,7 +896,6 @@ const HLJS = function(hljs) { listLanguages, getLanguage, registerAliases, - requireLanguage, autoDetection, inherit, addPlugin, diff --git a/types/index.d.ts b/types/index.d.ts index 3086671404..da8cdcb604 100644 --- a/types/index.d.ts +++ b/types/index.d.ts @@ -27,7 +27,6 @@ interface PublicApi { listLanguages: () => string[] registerAliases: (aliasList: string | string[], { languageName } : {languageName: string}) => void getLanguage: (languageName: string) => Language | undefined - requireLanguage: (languageName: string) => Language | never autoDetection: (languageName: string) => boolean inherit: (original: T, ...args: Record[]) => T addPlugin: (plugin: HLJSPlugin) => void