Added cursor protection extension

This commit is contained in:
2025-11-13 21:00:35 +08:00
parent d42f913250
commit dec3ef5ef4
3 changed files with 211 additions and 23 deletions

View File

@@ -25,6 +25,7 @@ import {getCodeBlockLanguageExtension} from './lang-parser';
import {createLanguageDetection} from './lang-detect';
import {SupportedLanguage} from './types';
import {getMathBlockExtensions} from './mathBlock';
import {createCursorProtection} from './cursorProtection';
/**
* 代码块扩展配置选项
@@ -108,6 +109,9 @@ export function createCodeBlockExtension(options: CodeBlockOptions = {}): Extens
showBackground
}),
// 光标保护(防止方向键移动到分隔符上)
createCursorProtection(),
// 块选择功能
...getBlockSelectExtensions(),
@@ -207,6 +211,11 @@ export {
getMathBlockExtensions
} from './mathBlock';
// 光标保护功能
export {
createCursorProtection
} from './cursorProtection';
/**
* 默认导出
*/