Merge branch 'planning_before_property_drawer'
Some checks failed
rustfmt Build rustfmt has succeeded
rust-foreign-document-test Build rust-foreign-document-test has failed
rust-build Build rust-build has succeeded
rust-test Build rust-test has succeeded

This commit is contained in:
Tom Alexander 2023-10-16 13:48:03 -04:00
commit 26f1eae9a1
Signed by: talexander
GPG Key ID: D3A179C9A53C0EDE
2 changed files with 13 additions and 2 deletions

View File

@ -0,0 +1,7 @@
** Foo
DEADLINE: <2023-10-16 Mon>
:PROPERTIES:
:foo: *a*
:Bar: *b*
:BAZ: *c*
:END:

View File

@ -101,11 +101,15 @@ impl<'s> Heading<'s> {
_ => None, _ => None,
}) })
.flat_map(|section| section.children.iter()) .flat_map(|section| section.children.iter())
.take(1) .take_while(|element| match element {
.filter_map(|element| match element { Element::Planning(_) | Element::PropertyDrawer(_) => true,
_ => false,
})
.find_map(|element| match element {
Element::PropertyDrawer(property_drawer) => Some(property_drawer), Element::PropertyDrawer(property_drawer) => Some(property_drawer),
_ => None, _ => None,
}) })
.into_iter()
.flat_map(|property_drawer| property_drawer.children.iter()) .flat_map(|property_drawer| property_drawer.children.iter())
} }
} }