Fix heading post-blank.

This commit is contained in:
Tom Alexander 2023-12-15 19:10:14 -05:00
parent 6b802d36bf
commit 99b74095e6
Signed by: talexander
GPG Key ID: D3A179C9A53C0EDE
2 changed files with 10 additions and 10 deletions

View File

@ -0,0 +1,5 @@
* foo
** bar
* baz

View File

@ -103,16 +103,11 @@ impl<'s> StandardProperties<'s> for Heading<'s> {
} }
fn get_post_blank(&self) -> PostBlank { fn get_post_blank(&self) -> PostBlank {
self.children self.post_blank
.last() .map(|text| text.lines().count())
.map(|child| child.get_post_blank()) .unwrap_or(0)
.unwrap_or( .try_into()
self.post_blank .expect("Too much post-blank to fit into a PostBlank.")
.map(|text| text.lines().count())
.unwrap_or(0)
.try_into()
.expect("Too much post-blank to fit into a PostBlank."),
)
} }
} }