Skip to main content

escape_into

Function escape_into 

pub fn escape_into(output: &mut String, input: &str)
Available on crate features html and http only.
Expand description

HTML-escape input into output (&, <, >, ", ').

Escaping ' as &#x27; is required so that interpolating untrusted strings into single-quoted attribute contexts (e.g. <input value='…'>) is safe. &apos; is intentionally not used because it is not part of HTML4 and some older agents do not recognize it.