From fd26b3f77cc573aa35f70b51fe0fb1d3633e4f5f Mon Sep 17 00:00:00 2001 From: Cassie Tarakajian Date: Wed, 30 Nov 2016 11:51:54 -0500 Subject: [PATCH] add otf and ttf to media file list for preview generation --- client/modules/IDE/components/PreviewFrame.jsx | 4 ++-- server/utils/previewGeneration.js | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/client/modules/IDE/components/PreviewFrame.jsx b/client/modules/IDE/components/PreviewFrame.jsx index 913fa0ba..a13b0cb6 100644 --- a/client/modules/IDE/components/PreviewFrame.jsx +++ b/client/modules/IDE/components/PreviewFrame.jsx @@ -8,8 +8,8 @@ import { getBlobUrl } from '../actions/files'; import { resolvePathToFile } from '../../../../server/utils/filePath'; const startTag = '@fs-'; -const MEDIA_FILE_REGEX = /^('|")(?!(http:\/\/|https:\/\/)).*\.(png|jpg|jpeg|gif|bmp|mp3|wav|aiff|ogg|json|txt|csv|svg|obj|mp4|ogg|webm|mov)('|")$/i; -const MEDIA_FILE_REGEX_NO_QUOTES = /^(?!(http:\/\/|https:\/\/)).*\.(png|jpg|jpeg|gif|bmp|mp3|wav|aiff|ogg|json|txt|csv|svg|obj|mp4|ogg|webm|mov)$/i; +const MEDIA_FILE_REGEX = /^('|")(?!(http:\/\/|https:\/\/)).*\.(png|jpg|jpeg|gif|bmp|mp3|wav|aiff|ogg|json|txt|csv|svg|obj|mp4|ogg|webm|mov|otf|ttf)('|")$/i; +const MEDIA_FILE_REGEX_NO_QUOTES = /^(?!(http:\/\/|https:\/\/)).*\.(png|jpg|jpeg|gif|bmp|mp3|wav|aiff|ogg|json|txt|csv|svg|obj|mp4|ogg|webm|mov|otf|ttf)$/i; const STRING_REGEX = /(['"])((\\\1|.)*?)\1/gm; const TEXT_FILE_REGEX = /(.+\.json$|.+\.txt$|.+\.csv$)/i; const NOT_EXTERNAL_LINK_REGEX = /^(?!(http:\/\/|https:\/\/))/; diff --git a/server/utils/previewGeneration.js b/server/utils/previewGeneration.js index 57efe73d..18c23635 100644 --- a/server/utils/previewGeneration.js +++ b/server/utils/previewGeneration.js @@ -1,7 +1,7 @@ import { resolvePathToFile } from '../utils/filePath'; -const MEDIA_FILE_REGEX = /^('|")(?!(http:\/\/|https:\/\/)).*\.(png|jpg|jpeg|gif|bmp|mp3|wav|aiff|ogg|json|txt|csv|svg|obj|mp4|ogg|webm|mov)('|")$/i; -const MEDIA_FILE_REGEX_NO_QUOTES = /^(?!(http:\/\/|https:\/\/)).*\.(png|jpg|jpeg|gif|bmp|mp3|wav|aiff|ogg|json|txt|csv|svg|obj|mp4|ogg|webm|mov)$/i; +const MEDIA_FILE_REGEX = /^('|")(?!(http:\/\/|https:\/\/)).*\.(png|jpg|jpeg|gif|bmp|mp3|wav|aiff|ogg|json|txt|csv|svg|obj|mp4|ogg|webm|mov|otf|ttf)('|")$/i; +const MEDIA_FILE_REGEX_NO_QUOTES = /^(?!(http:\/\/|https:\/\/)).*\.(png|jpg|jpeg|gif|bmp|mp3|wav|aiff|ogg|json|txt|csv|svg|obj|mp4|ogg|webm|mov|otf|ttf)$/i; const STRING_REGEX = /(['"])((\\\1|.)*?)\1/gm; const TEXT_FILE_REGEX = /(.+\.json$|.+\.txt$|.+\.csv$)/i; const EXTERNAL_LINK_REGEX = /^(http:\/\/|https:\/\/)/;