1
0
mirror of https://github.com/laurent22/joplin.git synced 2025-07-16 00:14:34 +02:00

Mobile,Desktop: Fixes #9971: Fix auto-indentation in some types of code blocks (#9972)

This commit is contained in:
Henry Heino
2024-02-22 07:35:54 -08:00
committed by GitHub
parent de03679be0
commit 2e3783f1c6
7 changed files with 41 additions and 15 deletions

View File

@ -0,0 +1,18 @@
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;