refactor(editor): extensionalize plain text adapter (#9330)

This commit is contained in:
donteatfriedrice
2024-12-26 07:27:07 +00:00
parent 45acdbda04
commit cadb9211a6
27 changed files with 226 additions and 120 deletions

View File

@@ -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,