lectito 0.3.0

Article extraction and readability parsing for Lectito.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
pub fn word_count(text: &str) -> usize {
    text.split_whitespace()
        .filter(|word| word.chars().any(char::is_alphanumeric))
        .count()
}

/// Escapes text for safe insertion into HTML text or attribute contexts.
pub fn escape_html(value: &str) -> String {
    value
        .replace('&', "&")
        .replace('<', "&lt;")
        .replace('>', "&gt;")
        .replace('"', "&quot;")
}