diff --git a/app/soapbox/components/media_gallery.js b/app/soapbox/components/media_gallery.js index 3eda57795..149aa3740 100644 --- a/app/soapbox/components/media_gallery.js +++ b/app/soapbox/components/media_gallery.js @@ -147,15 +147,30 @@ class Item extends React.PureComponent { if (attachment.get('type') === 'unknown') { const filename = truncateFilename(attachment.get('remote_url'), MAX_FILENAME_LENGTH); - return ( -
- - - - {filename} - -
- ); + var re = /(?:\.([^.]+))?$/; + const type = re.exec(filename)[1]; // e.g. "pdf" + if(type === 'pdf') { + return ( +
+