From 4a2d6d3035f5e1f866d6a8eb79a06cdbb8a2215d Mon Sep 17 00:00:00 2001 From: Cassie Tarakajian Date: Wed, 29 Aug 2018 15:06:41 -0400 Subject: [PATCH] fixes #668 --- client/modules/IDE/components/NewFileModal.jsx | 4 ++-- server/utils/fileUtils.js | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/client/modules/IDE/components/NewFileModal.jsx b/client/modules/IDE/components/NewFileModal.jsx index 9a3f13dc..aeed9598 100644 --- a/client/modules/IDE/components/NewFileModal.jsx +++ b/client/modules/IDE/components/NewFileModal.jsx @@ -71,8 +71,8 @@ function validate(formProps) { if (!formProps.name) { errors.name = 'Please enter a name'; - } else if (!formProps.name.match(/(.+\.js$|.+\.css$|.+\.json$|.+\.txt$|.+\.csv$)/i)) { - errors.name = 'File must be of type JavaScript, CSS, JSON, TXT, or CSV.'; + } else if (!formProps.name.match(/(.+\.js$|.+\.css$|.+\.json$|.+\.txt$|.+\.csv$|.+\.tsv$)/i)) { + errors.name = 'File must be of type JavaScript, CSS, JSON, TXT, CSV, or TSV.'; } return errors; diff --git a/server/utils/fileUtils.js b/server/utils/fileUtils.js index 3b14e1eb..0e6a7e58 100644 --- a/server/utils/fileUtils.js +++ b/server/utils/fileUtils.js @@ -20,7 +20,7 @@ export const MEDIA_FILE_QUOTED_REGEX = export const STRING_REGEX = /(['"])((\\\1|.)*?)\1/gm; // these are files that have to be linked to with a blob url -export const PLAINTEXT_FILE_REGEX = /.+\.(json|txt|csv|vert|frag)$/i; +export const PLAINTEXT_FILE_REGEX = /.+\.(json|txt|csv|vert|frag|tsv)$/i; // these are files that users would want to edit as text (maybe svg should be here?) export const TEXT_FILE_REGEX = /.+\.(json|txt|csv|vert|frag|js|css|html|htm|jsx)$/i; export const NOT_EXTERNAL_LINK_REGEX = /^(?!(http:\/\/|https:\/\/))/;