diff options
author | Martin Fischer <martin@push-f.com> | 2023-08-17 09:40:47 +0200 |
---|---|---|
committer | Martin Fischer <martin@push-f.com> | 2023-08-19 13:41:55 +0200 |
commit | c15895d44d17984386d3684e2aa85aca386ba3bf (patch) | |
tree | a7c92e5eff97bd7645c7d309c8bf94ea891459ad /README.md | |
parent | d5c9a851756b1e84b022c2fbf984137aae68e2c9 (diff) |
refactor!: make Emitter generic over offset instead of reader
Emitters should not have access to the reader at all. Also the
current position of the reader, at the time an Emitted method is
called, very much depends on machine implementation details such
as if `Tokenizer::unread_char` is used. Having the Emitter
methods take offsets lets the machine take care of providing
the right offsets, as evidenced by the next commit.
Diffstat (limited to 'README.md')
-rw-r--r-- | README.md | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -11,7 +11,7 @@ use std::fmt::Write; use html5tokenizer::{DefaultEmitter, Tokenizer, Token}; let html = "<title >hello world</title>"; -let emitter = DefaultEmitter::<_>::default(); +let emitter = DefaultEmitter::default(); let mut new_html = String::new(); for token in Tokenizer::new(html, emitter).flatten() { |