escape_html
Escapes the HTML special characters &, <, >, " and '.
Returns the input borrowed, without allocating, when there is nothing to escape. Use it to embed untrusted text in HTML text nodes or quoted attribute values.
Import
Section titled “Import”Cargo feature string (enabled by default). To compile only this module:
or in Cargo.toml:
Signature
Section titled “Signature”Parameters
Section titled “Parameters”| Parameter | Type | Description |
|---|---|---|
s | &str | The text to escape. |
Returns
Section titled “Returns”Cow<'_, str>
