Skip to content

Commit 4a2d6d3

Browse files
committed
fixes #668
1 parent 1451c3f commit 4a2d6d3

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

client/modules/IDE/components/NewFileModal.jsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,8 +71,8 @@ function validate(formProps) {
7171

7272
if (!formProps.name) {
7373
errors.name = 'Please enter a name';
74-
} else if (!formProps.name.match(/(.+\.js$|.+\.css$|.+\.json$|.+\.txt$|.+\.csv$)/i)) {
75-
errors.name = 'File must be of type JavaScript, CSS, JSON, TXT, or CSV.';
74+
} else if (!formProps.name.match(/(.+\.js$|.+\.css$|.+\.json$|.+\.txt$|.+\.csv$|.+\.tsv$)/i)) {
75+
errors.name = 'File must be of type JavaScript, CSS, JSON, TXT, CSV, or TSV.';
7676
}
7777

7878
return errors;

server/utils/fileUtils.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ export const MEDIA_FILE_QUOTED_REGEX =
2020

2121
export const STRING_REGEX = /(['"])((\\\1|.)*?)\1/gm;
2222
// these are files that have to be linked to with a blob url
23-
export const PLAINTEXT_FILE_REGEX = /.+\.(json|txt|csv|vert|frag)$/i;
23+
export const PLAINTEXT_FILE_REGEX = /.+\.(json|txt|csv|vert|frag|tsv)$/i;
2424
// these are files that users would want to edit as text (maybe svg should be here?)
2525
export const TEXT_FILE_REGEX = /.+\.(json|txt|csv|vert|frag|js|css|html|htm|jsx)$/i;
2626
export const NOT_EXTERNAL_LINK_REGEX = /^(?!(http:\/\/|https:\/\/))/;

0 commit comments

Comments
 (0)