Function e

Source
pub fn e<T, E>(
    text: T,
    escaper: E,
) -> Result<Safe<EscapeDisplay<T, E>>, Infallible>
Expand description

Alias for escape()

/// ```jinja
/// <div>{{ example|e }}</div>
/// ```
#[derive(Template)]
#[template(ext = "html", in_doc = true)]
struct Example<'a> {
    example: &'a str,
}

assert_eq!(
    Example { example: "Escape <>&" }.to_string(),
    "<div>Escape &#60;&#62;&#38;</div>"
);