pub fn sanitize_html(input: &str) -> String
Expand description
Sanitize HTML to prevent XSS attacks
This function escapes HTML special characters to prevent script injection. Use this for any user-provided content that will be displayed in HTML contexts.
ยงExample
use mockforge_core::validation::sanitize_html;
let malicious = "<script>alert('xss')</script>";
let safe = sanitize_html(malicious);
assert_eq!(safe, "<script>alert('xss')</script>");