summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorMartin Fischer <martin@push-f.com>2023-08-12 11:06:02 +0200
committerMartin Fischer <martin@push-f.com>2023-08-19 06:41:55 +0200
commit9f1019afa7a8e9102d67356d85bd632044eb2d0c (patch)
tree4c6664aad5a11a942d6684a62e507de28193f5bb /tests
parentc3d60e88efa32329614178dfc9455ef33ea0a88d (diff)
break!: merge Tokenizer::new_with_emitter into Tokenizer::new
The Tokenizer does not perform any state switching, since proper state switching requires a feedback loop between tokenization and DOM tree building. Using the Tokenizer directly therefore is a bit of a pitfall, since you might not expect it to e.g. tokenize `<script><b>` as: StartTag(StartTag { name: "script", .. }) StartTag(StartTag { name: "b", .. }) Since we don't want to make walking into pitfalls particularly easy, this commit changes the Tokenizer::new method so that you have to specify the Emitter. Since this makes new_with_emitter redundant it is removed.
Diffstat (limited to 'tests')
-rw-r--r--tests/test_spans.rs2
1 files changed, 1 insertions, 1 deletions
diff --git a/tests/test_spans.rs b/tests/test_spans.rs
index 64a64cf..8a820de 100644
--- a/tests/test_spans.rs
+++ b/tests/test_spans.rs
@@ -16,7 +16,7 @@ fn test() {
let file_id = files.add("test.html", html);
let mut labels = Vec::new();
- for token in Tokenizer::new_with_emitter(
+ for token in Tokenizer::new(
PosTrackingReader::new(html),
DefaultEmitter::<_, Range<usize>>::default(),
)