Line breaks in JSON

jmh530 john.michael.hall at gmail.com
Thu May 10 17:59:26 UTC 2018


On Thursday, 10 May 2018 at 15:01:57 UTC, rikki cattermole wrote:
> [snip]
>
> You'll need to unescape them (which is pretty easy, a simple 
> replacement here).
>
> For reference, this is invalid json[0]:
>
> ```
> {
> 	"1
> 	2
> 	3 "
> }
> ```
>
> [0] https://jsonlint.com/

I don't see an unescape function in phobos and below doesn't seem 
to work

string msg2 = parseJSON(msg)["markdown"].to!string.replace("\n", 
" ");


More information about the Digitalmars-d-learn mailing list