fix(media): embed additional direct image formats (#1146)

This commit is contained in:
Tommaso Casaburi
2026-05-30 23:45:21 +07:00
committed by GitHub
parent f3494cc6bd
commit e4638ac8c7
4 changed files with 30 additions and 2 deletions
@@ -131,7 +131,12 @@ describe('media-utils', () => {
});
expect(getLinkMediaInfo('https://example.com/file.gif')).toMatchObject({ type: 'gif' });
expect(getLinkMediaInfo('https://external-preview.redd.it/example.gif?width=480&format=mp4')).toMatchObject({ type: 'video' });
expect(getLinkMediaInfo('https://example.com/file.jfif')).toMatchObject({ type: 'image' });
expect(getLinkMediaInfo('https://example.com/file.jpe')).toMatchObject({ type: 'image' });
expect(getLinkMediaInfo('https://example.com/file.jif')).toMatchObject({ type: 'image' });
expect(getLinkMediaInfo('https://example.com/file.png')).toMatchObject({ type: 'image' });
expect(getLinkMediaInfo('https://example.com/file.apng')).toMatchObject({ type: 'image' });
expect(getLinkMediaInfo('https://example.com/file.avif')).toMatchObject({ type: 'image' });
expect(getLinkMediaInfo('https://example.com/file.mp4')).toMatchObject({ type: 'video' });
expect(getLinkMediaInfo('https://example.com/file.mp3')).toMatchObject({ type: 'audio' });
expect(getLinkMediaInfo('https://example.com/file.swf')).toMatchObject({ type: 'swf' });