From 45a506334c7b2d2e46610472e43cf083db4d94b1 Mon Sep 17 00:00:00 2001 From: Tom Alexander Date: Fri, 15 Dec 2023 15:20:31 -0500 Subject: [PATCH] Remove leading blank lines from heading contents. --- src/parser/headline.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/parser/headline.rs b/src/parser/headline.rs index a3889b32..6af43360 100644 --- a/src/parser/headline.rs +++ b/src/parser/headline.rs @@ -66,7 +66,7 @@ fn _heading<'b, 'g, 'r, 's>( let (remaining, pre_headline) = headline(context, input, parent_star_count)?; let section_matcher = bind_context!(section, context); let heading_matcher = bind_context!(heading(pre_headline.star_count), context); - let contents_begin = remaining; + let (contents_begin, _) = opt(many0(blank_line))(remaining)?; let (remaining, maybe_section) = opt(map(section_matcher, DocumentElement::Section))(remaining)?; let (remaining, _ws) = opt(tuple((start_of_line, many0(blank_line))))(remaining)?;