mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-07-13 16:16:46 +08:00
fix(editor): use img tag for link preview icon and banner (#11637)
close AF-2377
This commit is contained in:
@@ -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`
|
||||
|
||||
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user