summaryrefslogtreecommitdiff
path: root/extension/background.js
diff options
context:
space:
mode:
authorOmar Rizwan <omar@omar.website>2021-03-14 15:53:04 -0700
committerOmar Rizwan <omar@omar.website>2021-03-14 15:53:04 -0700
commit922e2bb6a369726ba029dc7dc7031c881780e231 (patch)
treef3c0125e28a8d7d768910ed2eadd5fc35b68b1a6 /extension/background.js
parent636a9758189c86bb66e2bcfa7283ae3a8c1e5728 (diff)
downloadTabFS-922e2bb6a369726ba029dc7dc7031c881780e231.tar.gz
TabFS-922e2bb6a369726ba029dc7dc7031c881780e231.zip
extension: also remove spaces; spaces in filenames are annoying, imo
Diffstat (limited to 'extension/background.js')
-rw-r--r--extension/background.js5
1 files changed, 4 insertions, 1 deletions
diff --git a/extension/background.js b/extension/background.js
index 2e66a32..ecb16cf 100644
--- a/extension/background.js
+++ b/extension/background.js
@@ -35,7 +35,10 @@ function pathComponent(path, i) {
const sanitize = (function() {
// from https://github.com/parshap/node-sanitize-filename/blob/209c39b914c8eb48ee27bcbde64b2c7822fdf3de/index.js
- var illegalRe = /[\/\?<>\\:\*\|"]/g;
+ // I've added ' ' to the list of illegal characters. it's a
+ // decision whether we want to allow spaces in filenames... I think
+ // they're annoying, so I'm sanitizing them out for now.
+ var illegalRe = /[\/\?<>\\:\*\|" ]/g;
var controlRe = /[\x00-\x1f\x80-\x9f]/g;
var reservedRe = /^\.+$/;
var windowsReservedRe = /^(con|prn|aux|nul|com[0-9]|lpt[0-9])(\..*)?$/i;