diff options
Diffstat (limited to 'src/construct/flow.rs')
-rw-r--r-- | src/construct/flow.rs | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/src/construct/flow.rs b/src/construct/flow.rs index 08c7891..f3c7685 100644 --- a/src/construct/flow.rs +++ b/src/construct/flow.rs @@ -35,28 +35,28 @@ use crate::tokenizer::Tokenizer; /// ``` pub fn start(tokenizer: &mut Tokenizer) -> State { match tokenizer.current { - Some(b'`' | b'~') => { + Some(b'#') => { tokenizer.attempt( State::Next(StateName::FlowAfter), State::Next(StateName::FlowBeforeParagraph), ); - State::Retry(StateName::CodeFencedStart) + State::Retry(StateName::HeadingAtxStart) } - Some(b'<') => { + Some(b'*' | b'_') => { tokenizer.attempt( State::Next(StateName::FlowAfter), State::Next(StateName::FlowBeforeParagraph), ); - State::Retry(StateName::HtmlFlowStart) + State::Retry(StateName::ThematicBreakStart) } - Some(b'#') => { + Some(b'<') => { tokenizer.attempt( State::Next(StateName::FlowAfter), State::Next(StateName::FlowBeforeParagraph), ); - State::Retry(StateName::HeadingAtxStart) + State::Retry(StateName::HtmlFlowStart) } - // Note: `-` is also used in thematic breaks, so it’s not included here. + // Note: `-` is also used in thematic breaks so it’s not included here. Some(b'=') => { tokenizer.attempt( State::Next(StateName::FlowAfter), @@ -64,22 +64,22 @@ pub fn start(tokenizer: &mut Tokenizer) -> State { ); State::Retry(StateName::HeadingSetextStart) } - Some(b'*' | b'_') => { + Some(b'[') => { tokenizer.attempt( State::Next(StateName::FlowAfter), State::Next(StateName::FlowBeforeParagraph), ); - State::Retry(StateName::ThematicBreakStart) + State::Retry(StateName::DefinitionStart) } - Some(b'[') => { + Some(b'`' | b'~') => { tokenizer.attempt( State::Next(StateName::FlowAfter), State::Next(StateName::FlowBeforeParagraph), ); - State::Retry(StateName::DefinitionStart) + State::Retry(StateName::CodeFencedStart) } // Actual parsing: blank line? Indented code? Indented anything? - // Also includes `-` which can be a setext heading underline or a thematic break. + // Also includes `-` which can be a setext heading underline or thematic break. None | Some(b'\t' | b'\n' | b' ' | b'-') => State::Retry(StateName::FlowBlankLineBefore), // Must be a paragraph. Some(_) => { |