aboutsummaryrefslogtreecommitdiffstats
path: root/src/construct/heading_setext.rs
diff options
context:
space:
mode:
authorLibravatar Titus Wormer <tituswormer@gmail.com>2022-07-18 11:30:49 +0200
committerLibravatar Titus Wormer <tituswormer@gmail.com>2022-07-18 11:30:49 +0200
commitb4aa82f0f1ea3143ab5f221b2c5f564158605c84 (patch)
tree526f25680d30ad615ee868366545895059384f22 /src/construct/heading_setext.rs
parent08b9e5b5c3eddbc948cc9952783c1925b90ed9e0 (diff)
downloadmarkdown-rs-b4aa82f0f1ea3143ab5f221b2c5f564158605c84.tar.gz
markdown-rs-b4aa82f0f1ea3143ab5f221b2c5f564158605c84.tar.bz2
markdown-rs-b4aa82f0f1ea3143ab5f221b2c5f564158605c84.zip
Fix token that should be void
Diffstat (limited to '')
-rw-r--r--src/construct/heading_setext.rs6
1 files changed, 4 insertions, 2 deletions
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));