mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-02-25 10:22:55 +08:00
refactor(editor): extensionalize plain text adapter (#9330)
This commit is contained in:
@@ -86,7 +86,9 @@ export async function getContentFromSlice(
|
||||
}
|
||||
processTextInSnapshot(snapshot, host);
|
||||
const adapter =
|
||||
type === 'markdown' ? new MarkdownAdapter(job) : new PlainTextAdapter(job);
|
||||
type === 'markdown'
|
||||
? new MarkdownAdapter(job)
|
||||
: new PlainTextAdapter(job, host.std.provider);
|
||||
const content = await adapter.fromSliceSnapshot({
|
||||
snapshot,
|
||||
assets: job.assetsManager,
|
||||
@@ -104,7 +106,7 @@ export async function getPlainTextFromSlice(host: EditorHost, slice: Slice) {
|
||||
return '';
|
||||
}
|
||||
processTextInSnapshot(snapshot, host);
|
||||
const plainTextAdapter = new PlainTextAdapter(job);
|
||||
const plainTextAdapter = new PlainTextAdapter(job, host.std.provider);
|
||||
const plainText = await plainTextAdapter.fromSliceSnapshot({
|
||||
snapshot,
|
||||
assets: job.assetsManager,
|
||||
|
||||
Reference in New Issue
Block a user