Skip to main content

decode_entities

Function decode_entities 

pub fn decode_entities(input: &str) -> Cow<'_, str>
Available on crate features html and http only.
Expand description

Decode HTML character references in input — all numeric references (&#169;, &#xA9;) plus the common named ones (&amp;, &mdash;, …).

Returns Cow::Borrowed when there is nothing to decode. Unknown or malformed references are left verbatim. This is the companion to escape/escape_into for consumers of the raw, undecoded text the tokenizer emits.