Remove leading blank lines from heading contents.

This commit is contained in:
Tom Alexander 2023-12-15 15:20:31 -05:00
parent e47901a67f
commit 45a506334c
Signed by: talexander
GPG Key ID: D3A179C9A53C0EDE

View File

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