diff --git a/org_mode_samples/sections_and_headings/heading_with_subheading_post_blank.org b/org_mode_samples/sections_and_headings/heading_with_subheading_post_blank.org new file mode 100644 index 0000000..e60807f --- /dev/null +++ b/org_mode_samples/sections_and_headings/heading_with_subheading_post_blank.org @@ -0,0 +1,5 @@ +* foo + +** bar + +* baz diff --git a/src/types/document.rs b/src/types/document.rs index 9015adc..837b741 100644 --- a/src/types/document.rs +++ b/src/types/document.rs @@ -103,16 +103,11 @@ impl<'s> StandardProperties<'s> for Heading<'s> { } fn get_post_blank(&self) -> PostBlank { - self.children - .last() - .map(|child| child.get_post_blank()) - .unwrap_or( - self.post_blank - .map(|text| text.lines().count()) - .unwrap_or(0) - .try_into() - .expect("Too much post-blank to fit into a PostBlank."), - ) + self.post_blank + .map(|text| text.lines().count()) + .unwrap_or(0) + .try_into() + .expect("Too much post-blank to fit into a PostBlank.") } }