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)?;