aboutsummaryrefslogtreecommitdiffstats
path: root/src/content/string.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/content/string.rs')
-rw-r--r--src/content/string.rs31
1 files changed, 16 insertions, 15 deletions
diff --git a/src/content/string.rs b/src/content/string.rs
index ce850e7..1eefd30 100644
--- a/src/content/string.rs
+++ b/src/content/string.rs
@@ -30,27 +30,28 @@ pub fn start(tokenizer: &mut Tokenizer) -> State {
pub fn before(tokenizer: &mut Tokenizer) -> State {
match tokenizer.current {
None => State::Ok,
- Some(b'&') => tokenizer.attempt(
- StateName::CharacterReferenceStart,
- State::Next(StateName::StringBefore),
- State::Next(StateName::StringBeforeData),
- ),
- Some(b'\\') => tokenizer.attempt(
- StateName::CharacterEscapeStart,
- State::Next(StateName::StringBefore),
- State::Next(StateName::StringBeforeData),
- ),
+ Some(b'&') => {
+ tokenizer.attempt(
+ State::Next(StateName::StringBefore),
+ State::Next(StateName::StringBeforeData),
+ );
+ State::Retry(StateName::CharacterReferenceStart)
+ }
+ Some(b'\\') => {
+ tokenizer.attempt(
+ State::Next(StateName::StringBefore),
+ State::Next(StateName::StringBeforeData),
+ );
+ State::Retry(StateName::CharacterEscapeStart)
+ }
_ => State::Retry(StateName::StringBeforeData),
}
}
/// At data.
pub fn before_data(tokenizer: &mut Tokenizer) -> State {
- tokenizer.attempt(
- StateName::DataStart,
- State::Next(StateName::StringBefore),
- State::Nok,
- )
+ tokenizer.attempt(State::Next(StateName::StringBefore), State::Nok);
+ State::Retry(StateName::DataStart)
}
/// Resolve whitespace.