Added dockerfile、lua prettier plugin

This commit is contained in:
2025-09-20 01:30:16 +08:00
parent 2ea3456ff7
commit c3670bb8cd
79 changed files with 3790 additions and 289 deletions

View File

@@ -6,17 +6,14 @@ import { EditorState } from '@codemirror/state';
import { syntaxTree, syntaxTreeAvailable } from '@codemirror/language';
import { Block as BlockNode, BlockDelimiter, BlockContent, BlockLanguage, Document } from './lang-parser/parser.terms.js';
import {
CodeBlock,
SupportedLanguage,
SUPPORTED_LANGUAGES,
DELIMITER_REGEX,
DELIMITER_PREFIX,
DELIMITER_SUFFIX,
AUTO_DETECT_SUFFIX,
ParseOptions,
LanguageDetectionResult,
Block
} from './types';
import { LANGUAGES } from './lang-parser/languages';
/**
* 从语法树解析代码块
@@ -397,7 +394,7 @@ export function parseDelimiter(delimiterText: string): { language: SupportedLang
const languageName = match[1];
const isAuto = match[2] === AUTO_DETECT_SUFFIX;
const validLanguage = SUPPORTED_LANGUAGES.includes(languageName as SupportedLanguage)
const validLanguage = LANGUAGES.some(lang => lang.token === languageName)
? languageName as SupportedLanguage
: 'text';