Skip to content

std::html

Status: experimental

HTML text escaping and unescaping.

API details and source

The implementation source contains the complete declarations and implementation notes. The table below lists canonical Gossamer call signatures; every item name links directly to its implementation file.

Item Canonical signature or declaration Description
escape fn escape(text: String) -> String Escapes HTML metacharacters (&, <, >, ", ').
render_json fn render_json(template: String, data: json::Value) -> Result<String, errors::Error> render_json(source, json_data) -> Result: renders a context-aware HTML template against a JSON data context. Stateless and wired bit-identically across every tier.
unescape fn unescape(text: String) -> String Resolves HTML entities back to their characters.