Struct maud_htmlescape::Escaper [−][src]
pub struct Escaper<'a>(_);
Expand description
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 ('
) was
escaped as well.
Example
ⓘ
use std::fmt::Write;
let mut s = String::new();
write!(Escaper::new(&mut s), "<script>launchMissiles()</script>").unwrap();
assert_eq!(s, "<script>launchMissiles()</script>");
Implementations
Trait Implementations
Writes a string slice into this writer, returning whether the write succeeded. Read more