summaryrefslogtreecommitdiff
path: root/examples/tokenize.rs
blob: da99dd3aa7f79732644b32e84a7d42a48189654a (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);
    }
}