Skip to content
Snippets Groups Projects
Commit e77c5d93 authored by Matthieu BENOIST's avatar Matthieu BENOIST
Browse files

Merge branch 'media-fix' into 'master'

Media fix

See merge request !25
parents c514c171 f5c44680
Branches
Tags v1.7.1
1 merge request!25Media fix
Pipeline #13580 passed
......@@ -5,7 +5,6 @@ import { ActivatedRoute, ParamMap } from '@angular/router';
import { Media } from '../../../models/media.model';
import { MediaService } from '../../../services';
import { highlight } from 'highlight.js';
import * as isImageUrl from 'is-image-url';
@Component({
selector: 'app-media-detail',
templateUrl: './media-detail.component.html',
......@@ -32,7 +31,7 @@ export class MediaDetailComponent implements OnInit {
}
get isImage() {
return isImageUrl(this.media.url);
return this.media.url.match(/\.(png|jpg|gif|jpeg|svg)$/g);
}
// [WARNING] Keep that weird indentation for correct display on the web page
......
......@@ -91,7 +91,7 @@ export class MediaComponent implements OnInit, OnDestroy {
}
isImage(url) {
return isImageUrl(url);
return url.match(/\.(png|jpg|gif|jpeg|svg)$/g);
}
copyGhostHTMLSnippet(media: Media, size: string, id) {
......
......@@ -21,9 +21,6 @@
"paths": {
"crypto": [
"../../node_modules/crypto-js"
],
"is-image": [
"../../node-modules/is-image"
]
}
},
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment