var c= {"Content":"</SCRIPT>"}
Gives parser error in Chrome. Escaping works ... </SCRIPT>
https://jsfiddle.net/OndrejSpilka327/banr9836/
Is it really chrome bug?
EDIT I don't think the argumentation is correct. HTML parser should have nothing to do with JavaScript parser. First of all, whatever is enclosed in should be parsed as JavaScript, not HTML. This is definitely wrong implementation of HTML parser.
For your curiosity:
var c= {"Content":"<SCRIPT></SCRIPT>"}
console.log(c.Content);
Produces the sam error in JSFiddle...and this is definitely well formed.
Again one can argue that SCRIPT tag can't occur inside outer SCRIPT tag, however whatever is enclosed in SCRIPT tags should be parsed as script not as HTML and especially if escaped in a regular string literal.
Such an argumentation only advocates bad implementation.
Obviously the behaviour produces errors when working with custom content serialized to json and persisted in SCRIPT tag.
Just curious what tags you removed Felix and why?
<SCRIPT></SCRIPT>should be parsed as JavaScript, not HTML. This is definitely wrong implementation of HTML parser." — No. The JavaScript is inside the HTML. You either need to parse the HTML (here is the start tag, here is a text node, here is the end tag, now pass the text node to the JS parser to be treated as JS) or you need to recognise the start tag and then switch to parsing JS until you reach the end of the JS which has no way to mark "the end of the JS" so that's impossible and HTML+JS are consequently not designed to be parsed like that.