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, 5 insertions, 3 deletions
diff --git a/src/tokenizer.rs b/src/tokenizer.rs
index cecc0f6..89d743a 100644
--- a/src/tokenizer.rs
+++ b/src/tokenizer.rs
@@ -218,14 +218,16 @@ 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() - 1);
+ self.emitter
+ .init_start_tag(self.reader.position() - "<".len() - 1);
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() - 1);
+ self.emitter
+ .init_end_tag(self.reader.position() - "</".len() - 1);
self.current_tag_name.clear();
self.is_start_tag = false;
}
@@ -238,7 +240,7 @@ impl<R: Reader + Position<O>, O: Offset, E: Emitter<O>> Tokenizer<R, O, E> {
#[inline]
pub(crate) fn emit_current_tag(&mut self) {
- self.emitter.emit_current_tag(self.reader.position() - 1);
+ self.emitter.emit_current_tag(self.reader.position());
if self.is_start_tag {
if self.naively_switch_state {
self.state = naive_next_state(&self.current_tag_name).into();