title: Remove new lines from JSON
body: <p>Consider I have the following string:</p>
  <pre><code>{
    &quot;{\n &lt;&lt;&lt;-- error
       \&quot;SomeKey\&quot;: {\n    \&quot;somevalue\&quot;: \&quot;test\&quot;,\n,
       \&quot;AnotherKey\&quot;: \&quot;Long string should be here \n another line break here \n and another line here \&quot;
      }
  }
  </code></pre>
  <p>When you try to parse this string with JSON.parse, it throws an error that points to the first line break. Is there any way to get rid of the line breaks without removing \n that is not within quotation marks.</p>