1
0
mirror of https://github.com/laurent22/joplin.git synced 2024-12-21 09:38:01 +02:00
joplin/packages/editor/CodeMirror/markdown/codeBlockLanguages/defaultLanguage.ts

19 lines
547 B
TypeScript
Raw Normal View History

import { LanguageDescription, LanguageSupport, StreamLanguage } from '@codemirror/language';
// To allow auto-indent to work in an unrecognised language, we define an
// empty language. Doing so seems to enable auto-indent in code blocks with
// that language.
const defaultLanguage = StreamLanguage.define({
token: (stream) => {
stream.next();
return null;
},
});
const defaultLanguageDescription = LanguageDescription.of({
name: 'default',
support: new LanguageSupport(defaultLanguage),
});
export default defaultLanguageDescription;