From 067c36956139786cd8645c17fd318a03c18b0bbc Mon Sep 17 00:00:00 2001 From: Raidou Date: Wed, 20 Sep 2017 14:43:43 +0800 Subject: [PATCH] fix when --out parameter contain more space, and support single quotes --- js/ctrls/modal.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/js/ctrls/modal.js b/js/ctrls/modal.js index a3c6df3..85b30fd 100644 --- a/js/ctrls/modal.js +++ b/js/ctrls/modal.js @@ -79,15 +79,15 @@ angular parse: function() { return _ .chain(this.uris.trim().split(/\r?\n/g)) - .map(function(d) { + .map(function(d) { return _(d) - .replace(/("[^"]*")/g, function(c) { - return c.replace('%','%25').replace(' ','%20'); + .replace(/["'][^"]*['"]/g, function(c) { + return c.replace(/%/g,'%25').replace(/ /g,'%20'); }) .trim() .split(/\s+/g) .map(function(c) { - return c.replace('%20',' ').replace('%25','%').replace(/"/g,''); + return c.replace(/%20/g,' ').replace(/%25/g,'%').replace(/["']/g,''); }); }) .filter(function(d) { return d.length })