Removing the file extension check on images

Since we're not checking mime types anyway, and most browser
supported image formats should probably render as attachments
on Mastodon and Pleroma, I'm removing this. There are often
normal JPEG and PNG images that get linked as an img src but
lack the standard file extensions, especially if it comes from
an API that returns the file binary.

Closes #36.
This commit is contained in:
Darius Kazemi 2019-05-25 10:12:39 -07:00
parent 54f61e6dc2
commit 9332e287ab

View file

@ -120,7 +120,7 @@ function transformContent(item) {
images.each((i,e) => {
let url = $(e).attr('src');
// if there's an image, add it as a media attachment
if (url && url.match(/(http)?s?:?(\/\/[^"']*\.(?:png|jpg|jpeg|gif|png|svg))/)) {
if (url) {
//console.log(url);
urls.push(url);
// remove the image from the post body since it's in the attachment now