Re: Embedding JSON with <script> tags inside <script> tags

On 06/03/2017 15:55 , Karen wrote:
> My question then is, what's an appropriate way to escape the JSON while
> still letting Google et al. parse it properly?

If I understand your problem correctly, you need the following (or its
equivalent in whatever language you're using):

  JSON.stringify(obj).replace(/<\/script/gi, '<\\u002fscript');

On the text value to set on the LD script element.

-- 
• Robin Berjon - http://berjon.com/ - @robinberjon
• http://science.ai/ — intelligent science publishing
•

Received on Monday, 6 March 2017 21:27:17 UTC