mirror of
https://github.com/bitsocialnet/5chan.git
synced 2026-08-03 07:41:04 +02:00
fix(post): some links to images could be embedded as videos
same as https://github.com/plebbit/seedit/issues/385
This commit is contained in:
@@ -80,7 +80,8 @@ export const getLinkMediaInfo = memoize(
|
||||
}
|
||||
|
||||
try {
|
||||
const fileName = url.pathname.slice(url.pathname.lastIndexOf('/') + 1).toLowerCase();
|
||||
const fileName = url.pathname.split('/').pop() || '';
|
||||
if (fileName.includes('.')) {
|
||||
mime = extName(fileName)[0]?.mime;
|
||||
if (mime) {
|
||||
if (mime.startsWith('image')) {
|
||||
@@ -91,6 +92,7 @@ export const getLinkMediaInfo = memoize(
|
||||
type = 'audio';
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (canEmbed(url) || url.host.startsWith('yt.')) {
|
||||
type = 'iframe';
|
||||
|
||||
Reference in New Issue
Block a user