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

close AF-2377
This commit is contained in:
forehalo
2025-04-11 08:48:04 +00:00
parent 9c6d94f597
commit 2f5647ac77
2 changed files with 3 additions and 16 deletions
@@ -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`
+1 -1
View File
@@ -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);