diff options
Diffstat (limited to '')
-rw-r--r-- | src/construct/html_flow.rs | 33 |
1 files changed, 19 insertions, 14 deletions
diff --git a/src/construct/html_flow.rs b/src/construct/html_flow.rs index 123e1a3..e90abc4 100644 --- a/src/construct/html_flow.rs +++ b/src/construct/html_flow.rs @@ -133,21 +133,26 @@ const COMPLETE: u8 = 7; pub fn start(tokenizer: &mut Tokenizer) -> State { if tokenizer.parse_state.constructs.html_flow { tokenizer.enter(Name::HtmlFlow); - tokenizer.attempt(State::Next(StateName::HtmlFlowBefore), State::Nok); - State::Retry(space_or_tab_with_options( - tokenizer, - SpaceOrTabOptions { - kind: Name::HtmlFlowData, - min: 0, - max: if tokenizer.parse_state.constructs.code_indented { - TAB_SIZE - 1 - } else { - usize::MAX + + if matches!(tokenizer.current, Some(b'\t' | b' ')) { + tokenizer.attempt(State::Next(StateName::HtmlFlowBefore), State::Nok); + State::Retry(space_or_tab_with_options( + tokenizer, + SpaceOrTabOptions { + kind: Name::HtmlFlowData, + min: 0, + max: if tokenizer.parse_state.constructs.code_indented { + TAB_SIZE - 1 + } else { + usize::MAX + }, + connect: false, + content: None, }, - connect: false, - content: None, - }, - )) + )) + } else { + State::Retry(StateName::HtmlFlowBefore) + } } else { State::Nok } |