mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-09-22 19:53:48 +08:00
fix(core): extract text blocks markdown from doc (#9879)
[AF-2162](https://linear.app/affine-design/issue/AF-2162/ai-提取-markdown-内容不完整)
This commit is contained in:
@@ -21,7 +21,6 @@ import {
|
|||||||
getSelectedTextContent,
|
getSelectedTextContent,
|
||||||
getTextContentFromBlockModels,
|
getTextContentFromBlockModels,
|
||||||
selectedToCanvas,
|
selectedToCanvas,
|
||||||
traverse,
|
|
||||||
} from './selection-utils';
|
} from './selection-utils';
|
||||||
|
|
||||||
export async function extractSelectedContent(
|
export async function extractSelectedContent(
|
||||||
@@ -165,7 +164,6 @@ export async function extractMarkdownFromDoc(
|
|||||||
!BlocksUtils.matchFlavours(model, ['affine:image', 'affine:database'])
|
!BlocksUtils.matchFlavours(model, ['affine:image', 'affine:database'])
|
||||||
);
|
);
|
||||||
const drafts = textModels.map(toDraftModel);
|
const drafts = textModels.map(toDraftModel);
|
||||||
drafts.forEach(draft => traverse(draft, drafts));
|
|
||||||
const slice = Slice.fromModels(doc, drafts);
|
const slice = Slice.fromModels(doc, drafts);
|
||||||
|
|
||||||
const snapshot = transformer.sliceToSnapshot(slice);
|
const snapshot = transformer.sliceToSnapshot(slice);
|
||||||
|
|||||||
Reference in New Issue
Block a user