escape_html

Function escape_html 

Source
pub fn escape_html<W: Write>(html: &str, writer: &mut W) -> Result
Expand description

Simple HTML escaping, so strings can be safely rendered.

//# use html_escaping;

// let mut buf = String::new();
// escape_html(r#"<hello world="attribute" />"#, &mut buf).unwrap();
// assert_eq!(buf, "&lt;hello world=&quot;attribute&quot; /&gt;");