Skip to main content

html_escape

Function html_escape 

Source
pub fn html_escape(s: &str) -> String
Expand description

Escape a string for safe HTML output inside a LiveComponent’s render().

fn render(&self) -> String {
    format!("<span>{}</span>", html_escape(&self.user_input))
}