diff options
Diffstat (limited to 'src/construct/heading_setext.rs')
-rw-r--r-- | src/construct/heading_setext.rs | 16 |
1 files changed, 5 insertions, 11 deletions
diff --git a/src/construct/heading_setext.rs b/src/construct/heading_setext.rs index 91a40b3..e31ce76 100644 --- a/src/construct/heading_setext.rs +++ b/src/construct/heading_setext.rs @@ -85,7 +85,8 @@ pub fn start(tokenizer: &mut Tokenizer) -> State { .name == Name::Paragraph) { - let name = space_or_tab_min_max( + tokenizer.attempt(State::Next(StateName::HeadingSetextBefore), State::Nok); + State::Retry(space_or_tab_min_max( tokenizer, 0, if tokenizer.parse_state.constructs.code_indented { @@ -93,13 +94,7 @@ pub fn start(tokenizer: &mut Tokenizer) -> State { } else { usize::MAX }, - ); - - tokenizer.attempt( - name, - State::Next(StateName::HeadingSetextBefore), - State::Nok, - ) + )) } else { State::Nok } @@ -139,12 +134,11 @@ pub fn inside(tokenizer: &mut Tokenizer) -> State { _ => { tokenizer.tokenize_state.marker = 0; tokenizer.exit(Name::HeadingSetextUnderline); - let name = space_or_tab(tokenizer); tokenizer.attempt( - name, State::Next(StateName::HeadingSetextAfter), State::Next(StateName::HeadingSetextAfter), - ) + ); + State::Retry(space_or_tab(tokenizer)) } } } |