diff options
author | Titus Wormer <tituswormer@gmail.com> | 2022-11-25 11:46:02 +0100 |
---|---|---|
committer | Titus Wormer <tituswormer@gmail.com> | 2022-11-25 11:46:02 +0100 |
commit | eea185ea8509d37a1f87babab75b1f94350db802 (patch) | |
tree | f8a120ff2ddabbcb13fab0a04df7d3181fc1f3fd /src/construct/heading_setext.rs | |
parent | 4f776347163a514abadc7ded95e66a459be03bc9 (diff) | |
download | markdown-rs-eea185ea8509d37a1f87babab75b1f94350db802.tar.gz markdown-rs-eea185ea8509d37a1f87babab75b1f94350db802.tar.bz2 markdown-rs-eea185ea8509d37a1f87babab75b1f94350db802.zip |
Fix double setext heading underlines
Related-to: GH-22.
Diffstat (limited to 'src/construct/heading_setext.rs')
-rw-r--r-- | src/construct/heading_setext.rs | 5 |
1 files changed, 2 insertions, 3 deletions
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); |