summaryrefslogtreecommitdiff
path: root/examples
diff options
context:
space:
mode:
authorMartin Fischer <martin@push-f.com>2023-08-12 12:58:08 +0200
committerMartin Fischer <martin@push-f.com>2023-08-19 13:53:58 +0200
commit0d9cd9ed44b676ccd4991cea27dc620b94ebe7e7 (patch)
treeaba2bff89958bbe4516a49caba5edffc866c64af /examples
parentb125bec9914bd211d77719bd60bc5a23bd9db579 (diff)
feat: introduce NaiveParser
Diffstat (limited to 'examples')
-rw-r--r--examples/naive-parser.rs13
1 files changed, 13 insertions, 0 deletions
diff --git a/examples/naive-parser.rs b/examples/naive-parser.rs
new file mode 100644
index 0000000..10fdf34
--- /dev/null
+++ b/examples/naive-parser.rs
@@ -0,0 +1,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);
+ }
+}