aboutsummaryrefslogtreecommitdiff
path: root/src/tokenizer.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/tokenizer.rs')
-rw-r--r--src/tokenizer.rs8
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;
}