Support empty sections under headings.

This commit is contained in:
Tom Alexander 2023-08-29 16:07:43 -04:00
parent 950baa9d5d
commit cc671925db
Signed by: talexander
GPG Key ID: D3A179C9A53C0EDE
1 changed files with 7 additions and 0 deletions

View File

@ -290,6 +290,13 @@ fn _heading<'r, 's>(
if let Some(section) = maybe_section {
children.insert(0, section);
}
let remaining = if children.is_empty() {
// Support empty headings
let (remain, _ws) = many0(blank_line)(remaining)?;
remain
} else {
remaining
};
let source = get_consumed(input, remaining);
Ok((