mirror of
https://github.com/pcottle/learnGitBranching.git
synced 2025-06-28 17:00:04 +02:00
fixed that escaping thing i think
This commit is contained in:
parent
ea3fe2f3eb
commit
46632988cf
2 changed files with 4 additions and 3 deletions
|
@ -274,7 +274,8 @@ OptionParser.prototype.explodeAndSet = function() {
|
||||||
// inside
|
// inside
|
||||||
var exploded = this.rawOptions.match(/('.*?'|".*?"|\S+)/g) || [];
|
var exploded = this.rawOptions.match(/('.*?'|".*?"|\S+)/g) || [];
|
||||||
_.each(exploded, function(part, i) {
|
_.each(exploded, function(part, i) {
|
||||||
exploded[i] = part.replace(/['"]/g, '');
|
exploded[i] = part.replace(/^['"]|['"]$/g, '');
|
||||||
|
console.log(exploded[i]);
|
||||||
});
|
});
|
||||||
|
|
||||||
for (var i = 0; i < exploded.length; i++) {
|
for (var i = 0; i < exploded.length; i++) {
|
||||||
|
|
|
@ -168,14 +168,14 @@ var CommandPromptView = Backbone.View.extend({
|
||||||
|
|
||||||
// split commands on semicolon
|
// split commands on semicolon
|
||||||
_.each(value.split(';'), _.bind(function(command, index) {
|
_.each(value.split(';'), _.bind(function(command, index) {
|
||||||
|
command = _.escape(command);
|
||||||
|
|
||||||
command = command
|
command = command
|
||||||
.replace(/^(\s+)/, '')
|
.replace(/^(\s+)/, '')
|
||||||
.replace(/(\s+)$/, '')
|
.replace(/(\s+)$/, '')
|
||||||
.replace(/"/g, '"')
|
.replace(/"/g, '"')
|
||||||
.replace(/'/g, "'");
|
.replace(/'/g, "'");
|
||||||
|
|
||||||
command = _.escape(command);
|
|
||||||
|
|
||||||
if (index > 0 && !command.length) {
|
if (index > 0 && !command.length) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue