mirror of
https://github.com/laurent22/joplin.git
synced 2024-12-24 10:27:10 +02:00
47f95cb294
Co-authored-by: Helmut K. C. Tessarek <tessarek@evermeet.cx> Co-authored-by: Henry Heino <46334387+personalizedrefrigerator@users.noreply.github.com>
19 lines
547 B
TypeScript
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;
|