mirror of
https://github.com/dariusk/rss-to-activitypub.git
synced 2024-11-22 17:29:19 +02:00
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:
parent
54f61e6dc2
commit
9332e287ab
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue