encodeReviewJsonForHtml function
Encodes value as JSON safe for embedding inside an HTML <script> tag.
Escapes </ as <\/ and <!-- as \u003c!-- so untrusted or arbitrary
titles, URLs, or metadata can never break out of <script>.
Implementation
String encodeReviewJsonForHtml(Object? value) =>
jsonEncode(value).replaceAll('</', r'<\/').replaceAll('<!--', r'\u003c!--');