Add formatting method

This commit is contained in:
2025-06-19 20:23:20 +08:00
parent 25858cb42b
commit 13072a00a1
15 changed files with 596 additions and 106 deletions

View File

@@ -214,6 +214,13 @@ export function createCodeBlockExtension(options: CodeBlockOptions = {}): Extens
run: transposeChars,
preventDefault: true
},
// 代码格式化命令
{
key: 'Mod-Shift-f', // 格式化代码
run: commands.formatCurrentBlock,
preventDefault: true
},
])
];
@@ -249,6 +256,9 @@ export {
// 命令
export * from './commands';
// 格式化功能
export { formatBlockContent } from './formatCode';
// 选择功能
export {
selectAll,