]> Untitled Git - lemmy.git/commitdiff
Fix image testing regex.
authorDessalines <tyhou13@gmx.com>
Thu, 27 Feb 2020 20:00:41 +0000 (15:00 -0500)
committerDessalines <tyhou13@gmx.com>
Thu, 27 Feb 2020 20:00:41 +0000 (15:00 -0500)
ui/src/components/post-listing.tsx
ui/src/utils.ts

index ef1dfd603a6f61b12c5a0918486cc58310ade222..8dbe1f48fe37a88bbe0d916fc7aa618b0f70c680 100644 (file)
@@ -187,7 +187,7 @@ export class PostListing extends Component<PostListingProps, PostListingState> {
                 onClick={linkEvent(this, this.handleImageExpandClick)}
               >
                 {this.imgThumbnail()}
-                <svg class="icon rounded link-overlay hover-link">
+                <svg class="icon thumbnail rounded link-overlay hover-link">
                   <use xlinkHref="#icon-image"></use>
                 </svg>
               </span>
@@ -199,7 +199,7 @@ export class PostListing extends Component<PostListingProps, PostListingState> {
                 title={this.state.url}
               >
                 {this.imgThumbnail()}
-                <svg class="icon rounded link-overlay hover-link">
+                <svg class="icon thumbnail rounded link-overlay hover-link">
                   <use xlinkHref="#icon-external-link"></use>
                 </svg>
               </a>
index d329dcd58e60958b75bc2e63335469da456cd965..9d2798efebdeeff0a4b7616a5f17e5b4151993a1 100644 (file)
@@ -159,10 +159,10 @@ export function isMod(modIds: Array<number>, creator_id: number): boolean {
   return modIds.includes(creator_id);
 }
 
-var imageRegex = new RegExp(
-  `(http)?s?:?(\/\/[^"']*\.(?:png|jpg|jpeg|gif|png|svg))`
+const imageRegex = new RegExp(
+  /(http)?s?:?(\/\/[^"']*\.(?:jpg|jpeg|gif|png|svg))/
 );
-var videoRegex = new RegExp(`(http)?s?:?(\/\/[^"']*\.(?:mp4))`);
+const videoRegex = new RegExp(`(http)?s?:?(\/\/[^"']*\.(?:mp4))`);
 
 export function isImage(url: string) {
   return imageRegex.test(url);