mkwebfont_extract-web 0.1.1

Internal crate for mkwebfont.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
use scraper::ElementRef;

pub fn direct_text_children(node: &ElementRef) -> String {
    let mut text = String::new();
    for child in node.children() {
        let child = child.value();
        if child.is_text() {
            text.push_str(&String::from_utf8_lossy(child.as_text().unwrap().as_bytes()));
        }
    }
    text
}