Skip to content

Commit 75a3a8a

Browse files
author
James Halliday
committed
passes its test
1 parent 704017d commit 75a3a8a

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

index.js

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,14 @@ module.exports = function parse (args, opts) {
88
index = i;
99
}
1010
if (inside && /\]$/.test(args[i])) {
11-
var sub = args.slice(index, i);
11+
var sub = args.slice(index, i + 1);
1212
sub[0] = sub[0].replace(/^\[/, '');
13-
sub[sub.length-1] = sub[sub.length-1].replace(/\[$/, '');
13+
if (sub[0] === '') sub.shift();
1414

15-
args.splice(index, i, parse(sub));
15+
sub[sub.length-1] = sub[sub.length-1].replace(/\]$/, '');
16+
if (sub[sub.length-1] === '') sub.pop();
1617

18+
args.splice(index, i - 1, parse(sub));
1719
inside = false;
1820
}
1921
}

0 commit comments

Comments
 (0)