fix embed crash

This commit is contained in:
7w1 committed 2026-07-09 14:15:56 -05:00
1 parent 04892f5136
commit 662c36d409
2 files changed
+9 -4

No files matched your search

+5
View File
@@ -0,0 +1,5 @@
---
default: patch
---
Fix crash with some embed links.
@@ -83,7 +83,7 @@ type RenderImageProps = {
tabIndex: number;
};
export type ImageContentProps = {
body: string;
body?: string;
mimeType?: string;
url: string;
info?: IImageInfo;
@@ -141,9 +141,9 @@ export const ImageContent = as<'div', ImageContentProps>(
info?.mimetype === 'image/gif' ||
info?.mimetype === 'image/apng' ||
info?.mimetype === 'image/webp' ||
body.toLowerCase().endsWith('.gif') ||
body.toLowerCase().endsWith('.apng') ||
body.toLowerCase().endsWith('.webp') ||
(body ?? '').toLowerCase().endsWith('.gif') ||
(body ?? '').toLowerCase().endsWith('.apng') ||
(body ?? '').toLowerCase().endsWith('.webp') ||
url.toLowerCase().endsWith('.gif') ||
url.toLowerCase().endsWith('.apng') ||
url.toLowerCase().endsWith('.webp');