Skip to content

There can be more than Notion and Miro. AFFiNE(pronounced [ə‘fain]) is a next-gen knowledge base that brings planning, sorting and creating all together. Privacy first, open-source, customizable and ready to use.

fix(editor): use img tag for link preview icon and banner (#11637)

forehalo2f5647ac77d3
diff --git a/blocksuite/affine/blocks/bookmark/src/components/bookmark-card.ts b/blocksuite/affine/blocks/bookmark/src/components/bookmark-card.ts
index cbe7717dff..bd8be9a7c8 100644
--- a/blocksuite/affine/blocks/bookmark/src/components/bookmark-card.ts
+++ b/blocksuite/affine/blocks/bookmark/src/components/bookmark-card.ts
@@ -81,21 +81,10 @@ export class BookmarkCard extends SignalWatcher(
const theme = this.bookmark.std.get(ThemeProvider).theme;
const { LoadingIcon, EmbedCardBannerIcon } = getEmbedCardIcons(theme);
- const titleIconType =
- !icon?.split('.').pop() || icon?.split('.').pop() === 'svg'
- ? 'svg+xml'
- : icon?.split('.').pop();
-
const titleIcon = this.loading
? LoadingIcon
: icon
- ? html`<object
- type="image/${titleIconType}"
- data=${icon}
- draggable="false"
- >
- ${WebIcon16}
- </object>`
+ ? html`<img src=${icon} alt="icon" />`
: WebIcon16;
const descriptionText = this.loading
@@ -108,9 +97,7 @@ export class BookmarkCard extends SignalWatcher(
const bannerImage =
!this.loading && image
- ? html`<object type="image/webp" data=${image} draggable="false">
- ${EmbedCardBannerIcon}
- </object>`
+ ? html`<img src=${image} alt="banner" />`
: EmbedCardBannerIcon;
return html`
diff --git a/packages/backend/server/src/app.module.ts b/packages/backend/server/src/app.module.ts
index ce32d008a7..6282c9bbb1 100644
--- a/packages/backend/server/src/app.module.ts
+++ b/packages/backend/server/src/app.module.ts
@@ -183,7 +183,7 @@ export function buildAppModule(env: Env) {
// doc service only
.useIf(() => env.flavors.doc, DocServiceModule)
// self hosted server only
- .useIf(() => env.selfhosted, WorkerModule, SelfhostModule)
+ .useIf(() => env.dev || env.selfhosted, WorkerModule, SelfhostModule)
// gcloud
.useIf(() => env.gcp, GCloudModule);