From eea185ea8509d37a1f87babab75b1f94350db802 Mon Sep 17 00:00:00 2001 From: Titus Wormer Date: Fri, 25 Nov 2022 11:46:02 +0100 Subject: Fix double setext heading underlines Related-to: GH-22. --- src/construct/heading_setext.rs | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'src/construct/heading_setext.rs') diff --git a/src/construct/heading_setext.rs b/src/construct/heading_setext.rs index 6e0ec08..d66f339 100644 --- a/src/construct/heading_setext.rs +++ b/src/construct/heading_setext.rs @@ -92,13 +92,12 @@ pub fn start(tokenizer: &mut Tokenizer) -> State { && !tokenizer.pierce // Require a paragraph before. && (!tokenizer.events.is_empty() - && tokenizer.events[skip::opt_back( + && matches!(tokenizer.events[skip::opt_back( &tokenizer.events, tokenizer.events.len() - 1, &[Name::LineEnding, Name::SpaceOrTab], )] - .name - == Name::Content) + .name, Name::Content | Name::HeadingSetextUnderline)) { tokenizer.enter(Name::HeadingSetextUnderline); -- cgit