aboutsummaryrefslogtreecommitdiffstats
path: root/src/construct/partial_title.rs
diff options
context:
space:
mode:
authorLibravatar Titus Wormer <tituswormer@gmail.com>2022-08-11 17:26:17 +0200
committerLibravatar Titus Wormer <tituswormer@gmail.com>2022-08-11 17:26:17 +0200
commit0d9c4611922535533746d1a86f10ef4e701c950e (patch)
treedd776161db75ba264b67830635b736ca5dd5c314 /src/construct/partial_title.rs
parent90969231bfcdfcd09bae646abba17d832b633376 (diff)
downloadmarkdown-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_title.rs')
-rw-r--r--src/construct/partial_title.rs14
1 files changed, 6 insertions, 8 deletions
diff --git a/src/construct/partial_title.rs b/src/construct/partial_title.rs
index 6421360..6f7a037 100644
--- a/src/construct/partial_title.rs
+++ b/src/construct/partial_title.rs
@@ -99,19 +99,17 @@ pub fn at_break(tokenizer: &mut Tokenizer) -> State {
State::Nok
}
Some(b'\n') => {
- let name = space_or_tab_eol_with_options(
+ tokenizer.attempt(
+ State::Next(StateName::TitleAfterEol),
+ State::Next(StateName::TitleAtBlankLine),
+ );
+ 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::TitleAfterEol),
- State::Next(StateName::TitleAtBlankLine),
- )
+ ))
}
Some(b'"' | b'\'' | b')')
if tokenizer.current.unwrap() == tokenizer.tokenize_state.marker =>