mirror of
https://github.com/bitsocialnet/5chan.git
synced 2026-08-03 07:41:04 +02:00
feat(post): add support for next.js image links
This commit is contained in:
@@ -75,6 +75,10 @@ export const getLinkMediaInfo = memoize(
|
|||||||
let type: string = 'webpage';
|
let type: string = 'webpage';
|
||||||
let mime: string | undefined;
|
let mime: string | undefined;
|
||||||
|
|
||||||
|
if (url.pathname === '/_next/image' && url.search.startsWith('?url=')) {
|
||||||
|
return { url: link, type: 'image' };
|
||||||
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
const fileName = url.pathname.slice(url.pathname.lastIndexOf('/') + 1).toLowerCase();
|
const fileName = url.pathname.slice(url.pathname.lastIndexOf('/') + 1).toLowerCase();
|
||||||
mime = extName(fileName)[0]?.mime;
|
mime = extName(fileName)[0]?.mime;
|
||||||
|
|||||||
Reference in New Issue
Block a user