mirror of
https://github.com/laurent22/joplin.git
synced 2025-01-02 12:47:41 +02:00
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 defaultLangauge = StreamLanguage.define({
|
||
|
token: (stream) => {
|
||
|
stream.next();
|
||
|
return null;
|
||
|
},
|
||
|
});
|
||
|
|
||
|
const defaultLanguageDescription = LanguageDescription.of({
|
||
|
name: 'default',
|
||
|
support: new LanguageSupport(defaultLangauge),
|
||
|
});
|
||
|
|
||
|
export default defaultLanguageDescription;
|