We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 1b87dc8 commit affbd82Copy full SHA for affbd82
lib/formatter.ex
@@ -216,18 +216,11 @@ defmodule Jason.Formatter do
216
{output_acc, &pp_string(&1, &2, in_bs, cont)}
217
end
218
219
- defp pp_string(<<byte, rest::binary>>, output_acc, true = _in_bs, cont) do
+ defp pp_string(binary, output_acc, true = _in_bs, cont) when is_binary(binary) do
220
+ <<byte, rest::binary>> = binary
221
pp_string(rest, [output_acc, byte], false, cont)
222
223
- defp pp_string(<<?", rest::binary>>, output_acc, false = _in_bs, cont) do
224
- cont.(rest, [output_acc, ?"])
225
- end
226
-
227
- defp pp_string(<<?\\, rest::binary>>, output_acc, false = _in_bs, cont) do
228
- pp_string(rest, [output_acc, ?\\], true, cont)
229
230
231
defp pp_string(binary, output_acc, false = _in_bs, cont) when is_binary(binary) do
232
case :binary.match(binary, ["\"", "\\"]) do
233
:nomatch ->
0 commit comments