aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--examples/tokenize.rs7
1 files changed, 5 insertions, 2 deletions
diff --git a/examples/tokenize.rs b/examples/tokenize.rs
index a7c2214..490d4a8 100644
--- a/examples/tokenize.rs
+++ b/examples/tokenize.rs
@@ -1,7 +1,7 @@
//! Let's you easily try out the tokenizer with e.g.
//! printf '<h1>Hello world!</h1>' | cargo run --example=tokenize
-use html5tokenizer::{BasicEmitter, Tokenizer};
+use html5tokenizer::{BasicEmitter, Event, Tokenizer};
use std::io::BufReader;
fn main() {
@@ -14,6 +14,9 @@ fn main() {
eprintln!("error: {:?}", error);
}
let token = token.unwrap();
- println!("{:?}", token);
+ match token {
+ Event::CdataOpen => println!("CDATA open"),
+ Event::Token(token) => println!("{token:?}"),
+ }
}
}