Skip to content
Snippets Groups Projects
Commit 0b3fc060 authored by Matthieu Benoist's avatar Matthieu Benoist
Browse files

Merge branch 'media-fix' into development

parents f9956c64 f5c44680
No related branches found
No related tags found
1 merge request!31Maj/node
Pipeline #13577 passed
...@@ -5,7 +5,6 @@ import { ActivatedRoute, ParamMap } from '@angular/router'; ...@@ -5,7 +5,6 @@ import { ActivatedRoute, ParamMap } from '@angular/router';
import { Media } from '../../../models/media.model'; import { Media } from '../../../models/media.model';
import { MediaService } from '../../../services'; import { MediaService } from '../../../services';
import { highlight } from 'highlight.js'; import { highlight } from 'highlight.js';
import * as isImageUrl from 'is-image-url';
@Component({ @Component({
selector: 'app-media-detail', selector: 'app-media-detail',
templateUrl: './media-detail.component.html', templateUrl: './media-detail.component.html',
...@@ -32,7 +31,7 @@ export class MediaDetailComponent implements OnInit { ...@@ -32,7 +31,7 @@ export class MediaDetailComponent implements OnInit {
} }
get isImage() { 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 // [WARNING] Keep that weird indentation for correct display on the web page
......
...@@ -91,7 +91,7 @@ export class MediaComponent implements OnInit, OnDestroy { ...@@ -91,7 +91,7 @@ export class MediaComponent implements OnInit, OnDestroy {
} }
isImage(url) { isImage(url) {
return isImageUrl(url); return url.match(/\.(png|jpg|gif|jpeg|svg)$/g);
} }
copyGhostHTMLSnippet(media: Media, size: string, id) { copyGhostHTMLSnippet(media: Media, size: string, id) {
......
...@@ -21,9 +21,6 @@ ...@@ -21,9 +21,6 @@
"paths": { "paths": {
"crypto": [ "crypto": [
"../../node_modules/crypto-js" "../../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