From b7909cdf6cadd7a205677acc5cda559a209d7706 Mon Sep 17 00:00:00 2001 From: litmus-ritten Date: Tue, 24 Aug 2021 14:21:11 +1000 Subject: [PATCH] landscape: altered RemoteContent regexes for images, video, and audio to include period literal. This prevents URLs ending in 'mov', 'ogg', etc. from rendering as empty video/audio, allowing people to learn about Isaac Asimov and William Rees-Mogg. --- pkg/interface/src/views/components/RemoteContent/index.tsx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pkg/interface/src/views/components/RemoteContent/index.tsx b/pkg/interface/src/views/components/RemoteContent/index.tsx index 8339f0be6..dc1dbaa8f 100644 --- a/pkg/interface/src/views/components/RemoteContent/index.tsx +++ b/pkg/interface/src/views/components/RemoteContent/index.tsx @@ -38,10 +38,10 @@ export interface RemoteContentProps { } export const IMAGE_REGEX = new RegExp( - /(jpg|img|png|gif|tiff|jpeg|webp|webm|svg)$/i + /(\.jpg|\.img|\.png|\.gif|\.tiff|\.jpeg|\.webp|\.webm|\.svg)$/i ); -export const AUDIO_REGEX = new RegExp(/(mp3|wav|ogg|m4a)$/i); -export const VIDEO_REGEX = new RegExp(/(mov|mp4|ogv)$/i); +export const AUDIO_REGEX = new RegExp(/(\.mp3|\.wav|\.ogg|\.m4a)$/i); +export const VIDEO_REGEX = new RegExp(/(\.mov|\.mp4|\.ogv)$/i); const emptyRef = () => {}; export function RemoteContent(props: RemoteContentProps) {