From c2eb1f51c8b641637963d4ff8242dcbaad27b1ae Mon Sep 17 00:00:00 2001 From: Tom Alexander Date: Fri, 8 Sep 2023 12:41:48 -0400 Subject: [PATCH] Support blank lines between nested headlines. --- src/parser/document.rs | 1 + 1 file changed, 1 insertion(+) diff --git a/src/parser/document.rs b/src/parser/document.rs index 8c50dbd..1c036d5 100644 --- a/src/parser/document.rs +++ b/src/parser/document.rs @@ -328,6 +328,7 @@ fn _heading<'b, 'g, 'r, 's>( let heading_matcher = parser_with_context!(heading(star_count))(context); let (remaining, maybe_section) = opt(map(section_matcher, DocumentElement::Section))(remaining)?; + let (remaining, _ws) = opt(tuple((start_of_line, many0(blank_line))))(remaining)?; let (remaining, mut children) = many0(map(heading_matcher, DocumentElement::Heading))(remaining)?; if let Some(section) = maybe_section {