mirror of
https://github.com/laurent22/joplin.git
synced 2024-12-18 09:35:20 +02:00
11 lines
400 B
TypeScript
11 lines
400 B
TypeScript
|
import { LanguageDescription } from '@codemirror/language';
|
||
|
import { languages } from '@codemirror/language-data';
|
||
|
import defaultLanguage from './defaultLanguage';
|
||
|
|
||
|
// Intended for use by the `markdown({ ... })` extension.
|
||
|
const lookUpLanguage = (languageInfo: string) => {
|
||
|
return LanguageDescription.matchLanguageName(languages, languageInfo) ?? defaultLanguage;
|
||
|
};
|
||
|
|
||
|
export default lookUpLanguage;
|