diff options
author | Martin Fischer <martin@push-f.com> | 2023-09-01 15:29:58 +0200 |
---|---|---|
committer | Martin Fischer <martin@push-f.com> | 2023-09-03 23:00:05 +0200 |
commit | eea8c60fba5962d5575c8515b837fb6304f73c9d (patch) | |
tree | 09722aca9a6e494c1f63dc7cc0266886a185ebdf /src/tokenizer.rs | |
parent | 03ca8c1f599828eb12e60e6012684bb4c09dbf89 (diff) |
refactor: also use some_offset for start/end tags
Diffstat (limited to 'src/tokenizer.rs')
-rw-r--r-- | src/tokenizer.rs | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/src/tokenizer.rs b/src/tokenizer.rs index 89d743a..83c3965 100644 --- a/src/tokenizer.rs +++ b/src/tokenizer.rs @@ -49,7 +49,7 @@ pub struct Tokenizer<R: Reader, O, E: Emitter<O>> { current_tag_name: String, last_start_tag_name: String, is_start_tag: bool, - /// * Set to the start offset of `<!doctype` in [`InternalState::MarkupDeclarationOpen`]. + /// * Set to the offset of `<` in [`InternalState::Data`]. /// * Set to the offset of `&` in [`InternalState::CharacterReference`]. pub(crate) some_offset: O, /// This boolean flag exists so that the [`NaiveParser`](crate::NaiveParser) can work with any [`Emitter`] @@ -218,16 +218,14 @@ impl<R: Reader + Position<O>, O: Offset, E: Emitter<O>> Tokenizer<R, O, E> { #[inline] pub(crate) fn init_start_tag(&mut self) { - self.emitter - .init_start_tag(self.reader.position() - "<".len() - 1); + self.emitter.init_start_tag(self.some_offset); self.current_tag_name.clear(); self.is_start_tag = true; } #[inline] pub(crate) fn init_end_tag(&mut self) { - self.emitter - .init_end_tag(self.reader.position() - "</".len() - 1); + self.emitter.init_end_tag(self.some_offset); self.current_tag_name.clear(); self.is_start_tag = false; } |