Skip to content

Commit

Permalink
better parse recursion to capture the containing quotes
Browse files Browse the repository at this point in the history
  • Loading branch information
James Halliday committed Apr 15, 2013
1 parent e9537b9 commit 8467961
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ exports.parse = function parse (s, env) {
else return s
.replace(/(^|[^\\])\$(\w+)/g, getVar)
.replace(/(^|[^\\])\${(\w+)}/g, getVar)
.replace(/(['"])((\\\1|[^\1])*?)\1/, function (_, q, s) {
.replace(/(['"])((\\\1|[^\1])*?)\1/, function (s, q) {
return parse(s, env);
})
.replace(/\\([ "'\\$`(){}!#&*|])/g, '$1')
Expand Down

0 comments on commit 8467961

Please sign in to comment.