fix when --out parameter contain more space, and support single quotes

This commit is contained in:
Raidou 2017-09-20 14:43:43 +08:00
parent 34823e27bb
commit 067c369561

View File

@ -81,13 +81,13 @@ angular
.chain(this.uris.trim().split(/\r?\n/g))
.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 })