I want to create JSON string api with latex formular, I found that JSON.parse
can not parse Latex formular like this:
{"id":19,"question":"<p>$\\left\\{ \\begin{align}</p><p> & 2\\left| x-1 \\right|+\\frac{y}{x+y}=6 \\\\ </p><p> & \\left| x-1 \\right|+\\frac{x}{x+y}=1 \\\\ </p><p class=\"ql-align-justify\">\\end{align} \\right.$"}
Sample test
t = '{"id":19,"question":"<p>$\\left\\{ \\begin{align}</p><p> & 2\\left| x-1 \\right|+\\frac{y}{x+y}=6 \\\\ </p><p> & \\left| x-1 \\right|+\\frac{x}{x+y}=1 \\\\ </p><p class=\"ql-align-justify\">\\end{align} \\right.$"}'
JSON.parse(t)
Error message Uncaught SyntaxError: Bad escaped character in JSON at position 26 (line 1 column 27)
Tried with online JSON lint / validator, input string is true json string.