Skip to content

Commit

Permalink
core: allow escaped forward slashes (\/) in strings
Browse files Browse the repository at this point in the history
ref #51
backports cc28091
  • Loading branch information
eiiches committed Dec 1, 2019
1 parent d44b4dc commit 6e6e681
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
1 change: 1 addition & 0 deletions jackson-jq/src/main/javacc/json-query.jj
Original file line number Diff line number Diff line change
Expand Up @@ -931,6 +931,7 @@ JsonQuery StringInterpolation():
case 'r': builder.append((char) 0x0d); break;
case 't': builder.append((char) 0x09); break;
case 'n': builder.append((char) 0x0a); break;
case '/': builder.append('/'); break;
default: {
throw new IllegalStateException("Unexpected escape char: " + c);
}
Expand Down
5 changes: 5 additions & 0 deletions jackson-jq/src/test/resources/jq-test-extra-ok.json
Original file line number Diff line number Diff line change
Expand Up @@ -724,5 +724,10 @@
"q": "try tonumber catch (\"__ERROR__\")",
"in": "foo",
"out": ["__ERROR__"]
},
{
"q": "\"\\/\"",
"in": null,
"out": ["/"]
}
]

0 comments on commit 6e6e681

Please sign in to comment.