//! Context-aware escaping helpers shared by the `OpenAPI` UI responders.
/// HTML-escape user-controlled text for safe interpolation into HTML text
/// nodes *or* double-quoted attribute values. Protects against the obvious
/// XSS sinks if `title` / `spec_url` ever originate from request parameters
/// (e.g. `Router::get("/docs/:title", ...)`).
///
/// Escapes `&`, `<`, `>`, `"`, and `'` to the corresponding HTML entities —
/// the minimal set that closes both element-context and attribute-context
/// injection.
pub
/// Escape `s` for use as a JavaScript string literal — including the
/// surrounding double quotes. Used for `url: {js}` / `theme: {js}` sinks in
/// `<script>` bodies, where HTML-entity encoding is NOT decoded.
///
/// Delegates to `serde_json::to_string`, which produces a valid JS string
/// literal (every JSON string is a valid JS string in browsers' modern
/// strict-superset parsers used here).
pub