This article is going to assume that you’re trying to insert HTML directly inside the JSON file.
The problem with HTML inside JSON is that HTML elements have properties that must use double quotes.
But as soon as you insert double quotes it’s going to cause syntax error because JSON can only do double quotes.
If you’re interested why this breaks, here’s an article to explain why, “Types – String“.
You can use HTML entities to escape that syntax error.
But it sometimes causes weird HTML side-effects.
Like adding double quotes around the double quotes. Or making link elements not work.
The best solution to implement HTML with properties is to escape strings.
Just add the backslash (
\) symbol before the beginning of a double quote and the before the end of a double quote.