aboutsummaryrefslogtreecommitdiffstats
path: root/src/construct/character_reference.rs
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--src/construct/character_reference.rs17
1 files changed, 8 insertions, 9 deletions
diff --git a/src/construct/character_reference.rs b/src/construct/character_reference.rs
index 6171927..7d7b6f9 100644
--- a/src/construct/character_reference.rs
+++ b/src/construct/character_reference.rs
@@ -81,15 +81,14 @@ use crate::util::slice::Slice;
/// ^
/// ```
pub fn start(tokenizer: &mut Tokenizer) -> State {
- match tokenizer.current {
- Some(b'&') if tokenizer.parse_state.constructs.character_reference => {
- tokenizer.enter(Name::CharacterReference);
- tokenizer.enter(Name::CharacterReferenceMarker);
- tokenizer.consume();
- tokenizer.exit(Name::CharacterReferenceMarker);
- State::Next(StateName::CharacterReferenceOpen)
- }
- _ => State::Nok,
+ if tokenizer.parse_state.constructs.character_reference && tokenizer.current == Some(b'&') {
+ tokenizer.enter(Name::CharacterReference);
+ tokenizer.enter(Name::CharacterReferenceMarker);
+ tokenizer.consume();
+ tokenizer.exit(Name::CharacterReferenceMarker);
+ State::Next(StateName::CharacterReferenceOpen)
+ } else {
+ State::Nok
}
}