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/defaultLanguage.ts
Laurent Cozic 47f95cb294
Chore: Implement cSpell to detect spelling mistakes in codebase (#10001)
Co-authored-by: Helmut K. C. Tessarek <tessarek@evermeet.cx>
Co-authored-by: Henry Heino <46334387+personalizedrefrigerator@users.noreply.github.com>
2024-02-26 10:16:23 +00:00

19 lines
547 B
TypeScript

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;