Add support for planning before property drawer when calculating additional properties for headlines.
This commit is contained in:
		
							parent
							
								
									d2d0e9e5dd
								
							
						
					
					
						commit
						3eff85059a
					
				| @ -0,0 +1,7 @@ | ||||
| ** Foo | ||||
| DEADLINE: <2023-10-16 Mon> | ||||
| :PROPERTIES: | ||||
| :foo:   *a* | ||||
| :Bar:   *b* | ||||
| :BAZ:   *c* | ||||
| :END: | ||||
| @ -101,11 +101,15 @@ impl<'s> Heading<'s> { | ||||
|                 _ => None, | ||||
|             }) | ||||
|             .flat_map(|section| section.children.iter()) | ||||
|             .take(1) | ||||
|             .filter_map(|element| match element { | ||||
|             .take_while(|element| match element { | ||||
|                 Element::Planning(_) | Element::PropertyDrawer(_) => true, | ||||
|                 _ => false, | ||||
|             }) | ||||
|             .find_map(|element| match element { | ||||
|                 Element::PropertyDrawer(property_drawer) => Some(property_drawer), | ||||
|                 _ => None, | ||||
|             }) | ||||
|             .into_iter() | ||||
|             .flat_map(|property_drawer| property_drawer.children.iter()) | ||||
|     } | ||||
| } | ||||
|  | ||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user
	 Tom Alexander
						Tom Alexander