You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Let's say I set the escape character to, say, "H" instead of backslash.
If I do parse("abcH def", {}, { escape: "H"}), the result ought to be ["abc def"], since the space was escaped. Instead, it doesn't work, and the result is ["abc", "def"]. The escape character has been correctly "eaten", but the space didn't actually get escaped.
Meanwhile, if I do parse("abc\\ def", {}, { escape: "H" }), then, since the backslash isn't acting as an escape, the result ought to be ["abc\\", "def"]. Instead one gets ["abc\\ def"]. The backslash is correctly not eaten, since it isn't acting as an escape... and yet the space gets escaped anyway, even though it shouldn't be!
I was thinking I might submit a PR for this, but I'm having trouble figuring out what is causing this... looking at the code, it appears correct. Dunno if something went wrong with the release process or something. Or maybe I'm just misreading and the bug really is there in the code and I can't see it. I don't know; well, here's an issue, hopefully you can figure it out.
Thank you!
(Tested with shell-quote versions 1.7.4 and 1.8.0)
The text was updated successfully, but these errors were encountered:
The example in the readme doesn't seem to show either the correct behavior or the one I described? It sets the escape character to "^", but then doesn't use any carets or backslashes in the string getting parsed. So it just doesn't show how the escape character works!
Let's say I set the escape character to, say,
"H"
instead of backslash.If I do
parse("abcH def", {}, { escape: "H"})
, the result ought to be["abc def"]
, since the space was escaped. Instead, it doesn't work, and the result is["abc", "def"]
. The escape character has been correctly "eaten", but the space didn't actually get escaped.Meanwhile, if I do
parse("abc\\ def", {}, { escape: "H" })
, then, since the backslash isn't acting as an escape, the result ought to be["abc\\", "def"]
. Instead one gets["abc\\ def"]
. The backslash is correctly not eaten, since it isn't acting as an escape... and yet the space gets escaped anyway, even though it shouldn't be!I was thinking I might submit a PR for this, but I'm having trouble figuring out what is causing this... looking at the code, it appears correct. Dunno if something went wrong with the release process or something. Or maybe I'm just misreading and the bug really is there in the code and I can't see it. I don't know; well, here's an issue, hopefully you can figure it out.
Thank you!
(Tested with shell-quote versions 1.7.4 and 1.8.0)
The text was updated successfully, but these errors were encountered: