summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/machine.rs4
-rw-r--r--src/tokenizer.rs5
2 files changed, 5 insertions, 4 deletions
diff --git a/src/machine.rs b/src/machine.rs
index 5910667..149b64d 100644
--- a/src/machine.rs
+++ b/src/machine.rs
@@ -947,7 +947,7 @@ where
}
Some('d' | 'D') if slf.try_read_string("octype", false)? => {
slf.state = State::Doctype;
- slf.doctype_offset = slf.reader.position() - b"<!doctype".len();
+ slf.some_offset = slf.reader.position() - b"<!doctype".len();
Ok(ControlToken::Continue)
}
Some('[') if slf.try_read_string("CDATA[", true)? => Ok(ControlToken::CdataOpen),
@@ -1895,7 +1895,7 @@ where
impl<R: Reader + Position<O>, O: Offset, E: Emitter<O>> Tokenizer<R, O, E> {
#[inline]
fn init_doctype(&mut self) {
- self.emitter.init_doctype(self.doctype_offset);
+ self.emitter.init_doctype(self.some_offset);
}
}
diff --git a/src/tokenizer.rs b/src/tokenizer.rs
index f76cad8..f41f5ae 100644
--- a/src/tokenizer.rs
+++ b/src/tokenizer.rs
@@ -49,7 +49,8 @@ pub struct Tokenizer<R: Reader, O, E: Emitter<O>> {
current_tag_name: String,
last_start_tag_name: String,
is_start_tag: bool,
- pub(crate) doctype_offset: O,
+ /// * Set to the start offset of `<!doctype` in [`InternalState::MarkupDeclarationOpen`].
+ pub(crate) some_offset: O,
/// This boolean flag exists so that the [`NaiveParser`](crate::NaiveParser) can work with any [`Emitter`]
/// (it cannot call [`Tokenizer::set_state`] using the emitted start tags since they can be of an arbitrary type).
pub(crate) naively_switch_state: bool,
@@ -75,7 +76,7 @@ impl<R: Reader + Position<O>, O: Offset, E: Emitter<O>> Tokenizer<R, O, E> {
current_tag_name: String::new(),
last_start_tag_name: String::new(),
is_start_tag: false,
- doctype_offset: O::default(),
+ some_offset: O::default(),
naively_switch_state: false,
}
}