From b4aa82f0f1ea3143ab5f221b2c5f564158605c84 Mon Sep 17 00:00:00 2001 From: Titus Wormer Date: Mon, 18 Jul 2022 11:30:49 +0200 Subject: Fix token that should be void --- src/construct/heading_setext.rs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'src/construct/heading_setext.rs') diff --git a/src/construct/heading_setext.rs b/src/construct/heading_setext.rs index 2078338..cb426a9 100644 --- a/src/construct/heading_setext.rs +++ b/src/construct/heading_setext.rs @@ -167,7 +167,10 @@ fn inside(tokenizer: &mut Tokenizer, code: Code, kind: Kind) -> StateFnResult { tokenizer.consume(code); (State::Fn(Box::new(move |t, c| inside(t, c, kind))), None) } - _ => tokenizer.attempt_opt(space_or_tab(), after)(tokenizer, code), + _ => { + tokenizer.exit(Token::HeadingSetextUnderline); + tokenizer.attempt_opt(space_or_tab(), after)(tokenizer, code) + } } } @@ -180,7 +183,6 @@ fn inside(tokenizer: &mut Tokenizer, code: Code, kind: Kind) -> StateFnResult { fn after(tokenizer: &mut Tokenizer, code: Code) -> StateFnResult { match code { Code::None | Code::CarriageReturnLineFeed | Code::Char('\n' | '\r') => { - tokenizer.exit(Token::HeadingSetextUnderline); // Feel free to interrupt. tokenizer.interrupt = false; tokenizer.register_resolver("heading_setext".to_string(), Box::new(resolve)); -- cgit