mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-02-13 21:05:19 +00:00
fix(core): wrap code in ai chat (#10108)
[BS-2540](https://linear.app/affine-design/issue/BS-2540/ai-chat-中-code-block-需要默认换行)
This commit is contained in:
11
blocksuite/affine/shared/src/adapters/middlewares/code.ts
Normal file
11
blocksuite/affine/shared/src/adapters/middlewares/code.ts
Normal file
@@ -0,0 +1,11 @@
|
||||
import type { TransformerMiddleware } from '@blocksuite/store';
|
||||
|
||||
export const CODE_BLOCK_WRAP_KEY = 'codeBlockWrap';
|
||||
|
||||
export const codeBlockWrapMiddleware = (
|
||||
wrap: boolean
|
||||
): TransformerMiddleware => {
|
||||
return ({ adapterConfigs }) => {
|
||||
adapterConfigs.set(CODE_BLOCK_WRAP_KEY, String(wrap));
|
||||
};
|
||||
};
|
||||
@@ -1,2 +1,3 @@
|
||||
export * from './code';
|
||||
export * from './copy';
|
||||
export * from './paste';
|
||||
|
||||
Reference in New Issue
Block a user