Skip to content

Commit

Permalink
Fix escaping for greater than and less than
Browse files Browse the repository at this point in the history
  • Loading branch information
Jacob Waddell authored and Jacob Waddell committed May 20, 2016
1 parent 88a5280 commit 70e9eb2
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
2 changes: 1 addition & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ exports.quote = function (xs) {
return '"' + s.replace(/(["\\$`!])/g, '\\$1') + '"';
}
else {
return String(s).replace(/([\\$`()!#&*|])/g, '\\$1');
return String(s).replace(/([\\$`()!#&*|><])/g, '\\$1');
}
}).join(' ');
};
Expand Down
1 change: 1 addition & 0 deletions test/quote.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ test('quote', function (t) {
t.equal(quote(["'#(){}*|][!"]), '"\'#(){}*|][\\!"');
t.equal(quote(["X#(){}*|][!"]), "X\\#\\(\\){}\\*\\|][\\!");
t.equal(quote(["a\n#\nb"]), "'a\n#\nb'");
t.equal(quote(['><']), '\\>\\<');
t.equal(quote([ 'a', 1, true, false ]), 'a 1 true false');
t.equal(quote([ 'a', 1, null, undefined ]), 'a 1 null undefined');
t.end();
Expand Down

0 comments on commit 70e9eb2

Please sign in to comment.