aboutsummaryrefslogtreecommitdiff
path: root/examples/tokenize.rs
blob: 54ba0ec1e3e267d953e0a8bbf83fad7d6cf4c1af (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
//! Let's you easily try out the tokenizer with e.g.
//! printf '<h1>Hello world!</h1>' | cargo run --example=tokenize

use html5tokenizer::{DefaultEmitter, Tokenizer};
use std::io::BufReader;

fn main() {
    for token in Tokenizer::new(
        BufReader::new(std::io::stdin().lock()),
        DefaultEmitter::<_>::default(),
    )
    .flatten()
    {
        println!("{:?}", token);
    }
}