pub fn html_encode(input: &str) -> StringExpand description
HTML entity encode a string
Encodes HTML special characters to their entity equivalents. This is useful for preventing XSS attacks.
§Arguments
input- String to HTML encode
§Example
ⓘ
let encoded = html_encode("<script>alert('xss')</script>");
assert_eq!(encoded, "<script>alert('xss')</script>");