Line break inside a JSON string

A JSON string can't hold a raw line break. RFC 8259 says control characters, U+0000 through U+001F, must be escaped inside strings. A line break is one of them, and so is a tab. To put a new line in the text, write the two characters \n. This error usually comes from pasting multi-line text, like an address or a message, into a string by hand.

In Chrome and Node.js, JSON.parse says: Bad control character in string literal in JSON

Broken
{
  "address": "12 St James's Square
London SW1Y 4LB"
}
Fixed
{
  "address": "12 St James's Square\nLondon SW1Y 4LB"
}

Fix it by hand

Join the lines and write \n where each line break was.

Open this example in j2n