foxtive 0.25.6

Foxtive Framework
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
#[cfg(feature = "html-sanitizer")]
pub use ammonia;

pub struct InputSanitizer;

impl InputSanitizer {
    pub fn sanitize_filename(input: &str) -> String {
        input
            .chars()
            .filter(|c| c.is_alphanumeric() || *c == '.' || *c == '_' || *c == '-')
            .collect()
    }

    #[cfg(feature = "html-sanitizer")]
    pub fn sanitize_html(input: &str) -> String {
        ammonia::clean(input)
    }
}