//! JSON string escaping utility shared by rendering crates.
use Write;
/// Append a JSON-escaped, double-quoted string to `out`.
///
/// Escapes the usual JSON characters (`"`, `\`, `\n`, `\r`, `\t`, and
/// control characters below U+0020). When `escape_html` is true,
/// also escapes `<` as `\u003c` to prevent `</script>` injection when
/// embedding JSON in HTML `<script>` tags.