pub fn html<'a, S: Into<Cow<'a, str>>>(input: S) -> Cow<'a, str>Expand description
Escape characters for HTML output, replacing <, >, and & with appropriate
HTML entities.
Also remove the entities that cause problems in strict XHTML with XML1.
Warning: this function was written for escaping text in a markdown text processor that is designed to run on a local machine, where the content can actually be trusted. It should not be used for untrusted content.
ยงExample
use crowbook_text_processing::escape;
let s = escape::html("<foo> & <bar>");
assert_eq!(&s, "<foo> & <bar>");