summaryrefslogtreecommitdiff
path: root/examples/naive-parser.rs
blob: 10fdf345fb3244bea18d85cd98ed3041da56ce8a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
//! Let's you easily try out the NaiveParser with e.g.
//! printf '<style><b>Hello world!</b></style>' | cargo run --example=naive-parser
use html5tokenizer::NaiveParser;
use std::io::{stdin, BufReader};

fn main() {
    let stdin = stdin();

    for token in NaiveParser::new(BufReader::new(stdin.lock())) {
        let token = token.unwrap();
        println!("{:?}", token);
    }
}