Suppose an API returns JSON response like this
{"error":"","data":"xxx"}
And in the place of xxx
it returns HTML code/page.
Does this HTML need some escaping like HTML escaping or JSON-escaping?
Is it better to be HTML-escaped or not?
Could this HTML in some cases break the JSON surrounding it, and if so what should be done for that not to happen?
I just wonder what the best practice is regarding this.