From 067c36956139786cd8645c17fd318a03c18b0bbc Mon Sep 17 00:00:00 2001 From: Raidou Date: Wed, 20 Sep 2017 14:43:43 +0800 Subject: [PATCH 1/2] 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 }) From b41c78206d8663b7f4b7abee9a5d4a04124a10e4 Mon Sep 17 00:00:00 2001 From: Weirong Xu Date: Wed, 20 Sep 2017 22:19:50 +0800 Subject: [PATCH 2/2] fix single quotes match --- js/ctrls/modal.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/js/ctrls/modal.js b/js/ctrls/modal.js index 85b30fd..55d9c6d 100644 --- a/js/ctrls/modal.js +++ b/js/ctrls/modal.js @@ -81,7 +81,7 @@ angular .chain(this.uris.trim().split(/\r?\n/g)) .map(function(d) { return _(d) - .replace(/["'][^"]*['"]/g, function(c) { + .replace(/["'][^"']*["']/g, function(c) { return c.replace(/%/g,'%25').replace(/ /g,'%20'); }) .trim()