aboutsummaryrefslogtreecommitdiffstats
path: root/src/construct/heading_atx.rs
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--src/construct/heading_atx.rs18
1 files changed, 15 insertions, 3 deletions
diff --git a/src/construct/heading_atx.rs b/src/construct/heading_atx.rs
index 45c4758..e5bc3bd 100644
--- a/src/construct/heading_atx.rs
+++ b/src/construct/heading_atx.rs
@@ -77,7 +77,11 @@ pub fn start(tokenizer: &mut Tokenizer) -> State {
usize::MAX
},
);
- tokenizer.go(state_name, StateName::HeadingAtxBefore)
+ tokenizer.attempt(
+ state_name,
+ State::Fn(StateName::HeadingAtxBefore),
+ State::Nok,
+ )
} else {
State::Nok
}
@@ -120,7 +124,11 @@ pub fn sequence_open(tokenizer: &mut Tokenizer) -> State {
tokenizer.tokenize_state.size = 0;
tokenizer.exit(Token::HeadingAtxSequence);
let state_name = space_or_tab(tokenizer);
- tokenizer.go(state_name, StateName::HeadingAtxAtBreak)
+ tokenizer.attempt(
+ state_name,
+ State::Fn(StateName::HeadingAtxAtBreak),
+ State::Nok,
+ )
}
_ => {
tokenizer.tokenize_state.size = 0;
@@ -146,7 +154,11 @@ pub fn at_break(tokenizer: &mut Tokenizer) -> State {
}
Some(b'\t' | b' ') => {
let state_name = space_or_tab(tokenizer);
- tokenizer.go(state_name, StateName::HeadingAtxAtBreak)
+ tokenizer.attempt(
+ state_name,
+ State::Fn(StateName::HeadingAtxAtBreak),
+ State::Nok,
+ )
}
Some(b'#') => {
tokenizer.enter(Token::HeadingAtxSequence);