diff options
author | Titus Wormer <tituswormer@gmail.com> | 2022-08-11 17:26:17 +0200 |
---|---|---|
committer | Titus Wormer <tituswormer@gmail.com> | 2022-08-11 17:26:17 +0200 |
commit | 0d9c4611922535533746d1a86f10ef4e701c950e (patch) | |
tree | dd776161db75ba264b67830635b736ca5dd5c314 /src/construct/partial_label.rs | |
parent | 90969231bfcdfcd09bae646abba17d832b633376 (diff) | |
download | markdown-rs-0d9c4611922535533746d1a86f10ef4e701c950e.tar.gz markdown-rs-0d9c4611922535533746d1a86f10ef4e701c950e.tar.bz2 markdown-rs-0d9c4611922535533746d1a86f10ef4e701c950e.zip |
Refactor attempts to remove unneeded state name
Diffstat (limited to 'src/construct/partial_label.rs')
-rw-r--r-- | src/construct/partial_label.rs | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/src/construct/partial_label.rs b/src/construct/partial_label.rs index 762baaa..0f7aa00 100644 --- a/src/construct/partial_label.rs +++ b/src/construct/partial_label.rs @@ -103,18 +103,17 @@ pub fn at_break(tokenizer: &mut Tokenizer) -> State { } else { match tokenizer.current { Some(b'\n') => { - let name = space_or_tab_eol_with_options( + tokenizer.attempt( + State::Next(StateName::LabelEolAfter), + State::Next(StateName::LabelAtBlankLine), + ); + State::Retry(space_or_tab_eol_with_options( tokenizer, Options { content_type: Some(Content::String), connect: tokenizer.tokenize_state.connect, }, - ); - tokenizer.attempt( - name, - State::Next(StateName::LabelEolAfter), - State::Next(StateName::LabelAtBlankLine), - ) + )) } Some(b']') => { tokenizer.exit(tokenizer.tokenize_state.token_3.clone()); |