Merge pull request #388 from weirongxu/fix-out-parameter

fix when --out parameter contain more spaces, and support single quotes
This commit is contained in:
hamza zia 2017-09-21 03:08:46 +08:00 committed by GitHub
commit 365b0a40fe

View File

@ -79,15 +79,15 @@ angular
parse: function() { parse: function() {
return _ return _
.chain(this.uris.trim().split(/\r?\n/g)) .chain(this.uris.trim().split(/\r?\n/g))
.map(function(d) { .map(function(d) {
return _(d) return _(d)
.replace(/("[^"]*")/g, function(c) { .replace(/["'][^"']*["']/g, function(c) {
return c.replace('%','%25').replace(' ','%20'); return c.replace(/%/g,'%25').replace(/ /g,'%20');
}) })
.trim() .trim()
.split(/\s+/g) .split(/\s+/g)
.map(function(c) { .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 }) .filter(function(d) { return d.length })