pub struct Escaper<'a>(_);
An adapter that escapes HTML special characters.
The following characters are escaped:
&is escaped as
<is escaped as
>is escaped as
"is escaped as
All other characters are passed through unchanged.
Note: In versions prior to 0.13, the single quote (
escaped as well.
use maud::Escaper; use std::fmt::Write; let mut s = String::new(); write!(Escaper::new(&mut s), "<script>launchMissiles()</script>").unwrap(); assert_eq!(s, "<script>launchMissiles()</script>");
Writes a string slice into this writer, returning whether the write succeeded. Read more