Skip to content

Commit

Permalink
feat(page): support import external images (toeverything#6321)
Browse files Browse the repository at this point in the history
  • Loading branch information
zkwolf authored Feb 29, 2024
1 parent 293cedd commit d24ab68
Showing 1 changed file with 8 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,10 @@ export async function importMarkDown(workspace: Workspace, text: string) {
});
const mdAdapter = new MarkdownAdapter();
mdAdapter.applyConfigs(job.adapterConfigs);
const snapshot = await mdAdapter.toDocSnapshot({ file: text });
const snapshot = await mdAdapter.toDocSnapshot({
file: text,
assets: job.assetsManager,
});
const page = await job.snapshotToDoc(snapshot);
return [page.id];
}
Expand All @@ -49,7 +52,10 @@ export async function importHtml(workspace: Workspace, text: string) {
});
const htmlAdapter = new NotionHtmlAdapter();
htmlAdapter.applyConfigs(job.adapterConfigs);
const snapshot = await htmlAdapter.toDocSnapshot({ file: text });
const snapshot = await htmlAdapter.toDocSnapshot({
file: text,
assets: job.assetsManager,
});
const page = await job.snapshotToDoc(snapshot);
return [page.id];
}
Expand Down

0 comments on commit d24ab68

Please sign in to comment.