1 points · by seph-reed · 7mo ago · 1 comment
Depending on scenario, I might just make a string literal object and avoid json all together. Or maybe I have to find and replace newlines for \n. Or maybe I try a different spec. But it always feels unfulfilling.
Has anyone found something that feels good?
$ irb
query = <<-json
{ "s": "a string with
newlines"
}
json
=> "{ \"s\": \"a string with\nnewlines\"\n}\n"