diff options
author | Titus Wormer <tituswormer@gmail.com> | 2022-08-12 14:21:53 +0200 |
---|---|---|
committer | Titus Wormer <tituswormer@gmail.com> | 2022-08-12 14:21:53 +0200 |
commit | 504729a4a0c8f3e0d8fc9159e0273150b169e184 (patch) | |
tree | a6bf291322decccd6011580337b1feed6151b554 /src/construct/block_quote.rs | |
parent | db5a491e6c2223d1db9b458307431a54db3c40f2 (diff) | |
download | markdown-rs-504729a4a0c8f3e0d8fc9159e0273150b169e184.tar.gz markdown-rs-504729a4a0c8f3e0d8fc9159e0273150b169e184.tar.bz2 markdown-rs-504729a4a0c8f3e0d8fc9159e0273150b169e184.zip |
Refactor to improve docs of each function
Diffstat (limited to '')
-rw-r--r-- | src/construct/block_quote.rs | 34 |
1 files changed, 7 insertions, 27 deletions
diff --git a/src/construct/block_quote.rs b/src/construct/block_quote.rs index 1a32f7d..6e660cb 100644 --- a/src/construct/block_quote.rs +++ b/src/construct/block_quote.rs @@ -47,39 +47,17 @@ use crate::tokenizer::Tokenizer; /// ``` pub fn start(tokenizer: &mut Tokenizer) -> State { if tokenizer.parse_state.constructs.block_quote { - tokenizer.attempt(State::Next(StateName::BlockQuoteBefore), State::Nok); - State::Retry(space_or_tab_min_max( - tokenizer, - 0, - if tokenizer.parse_state.constructs.code_indented { - TAB_SIZE - 1 - } else { - usize::MAX - }, - )) + tokenizer.enter(Name::BlockQuote); + State::Retry(StateName::BlockQuoteContStart) } else { State::Nok } } -/// Start of block quote, after whitespace, before `>`. -/// -/// ```markdown -/// > | > a -/// ^ -/// ``` -pub fn before(tokenizer: &mut Tokenizer) -> State { - match tokenizer.current { - Some(b'>') => { - tokenizer.enter(Name::BlockQuote); - State::Retry(StateName::BlockQuoteContBefore) - } - _ => State::Retry(StateName::BlockQuoteContBefore), - } -} - /// Start of block quote continuation. /// +/// Also used to parse the first block quote opening. +/// /// ```markdown /// | > a /// > | > b @@ -98,7 +76,9 @@ pub fn cont_start(tokenizer: &mut Tokenizer) -> State { )) } -/// After whitespace, before `>`. +/// At `>`, after optional whitespace. +/// +/// Also used to parse the first block quote opening. /// /// ```markdown /// | > a |