1
0
mirror of https://github.com/laurent22/joplin.git synced 2024-12-24 10:27:10 +02:00
joplin/packages/editor/CodeMirror/markdown/codeBlockLanguages/lookUpLanguage.ts

11 lines
400 B
TypeScript
Raw Normal View History

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;