Implement the new fields for org macro.
This commit is contained in:
		
							parent
							
								
									87ce7d7432
								
							
						
					
					
						commit
						aba29df34c
					
				| @ -32,7 +32,7 @@ pub(crate) fn org_macro<'b, 'g, 'r, 's>( | ||||
|     let (remaining, macro_args) = opt(parser_with_context!(org_macro_args)(context))(remaining)?; | ||||
|     let (remaining, _) = tag("}}}")(remaining)?; | ||||
|     let macro_value = get_consumed(input, remaining); | ||||
|     let (remaining, _trailing_whitespace) = | ||||
|     let (remaining, post_blank) = | ||||
|         maybe_consume_object_trailing_whitespace_if_not_exiting(context, remaining)?; | ||||
| 
 | ||||
|     let source = get_consumed(input, remaining); | ||||
| @ -47,6 +47,7 @@ pub(crate) fn org_macro<'b, 'g, 'r, 's>( | ||||
|                 .map(|arg| arg.into()) | ||||
|                 .collect(), | ||||
|             value: Into::<&str>::into(macro_value), | ||||
|             post_blank: post_blank.map(Into::<&str>::into), | ||||
|         }, | ||||
|     )) | ||||
| } | ||||
|  | ||||
| @ -177,6 +177,7 @@ pub struct OrgMacro<'s> { | ||||
|     pub args: Vec<&'s str>, | ||||
| 
 | ||||
|     pub value: &'s str, | ||||
|     pub post_blank: Option<&'s str>, | ||||
| } | ||||
| 
 | ||||
| #[derive(Debug)] | ||||
| @ -745,11 +746,15 @@ impl<'s> StandardProperties<'s> for OrgMacro<'s> { | ||||
|     } | ||||
| 
 | ||||
|     fn get_contents<'b>(&'b self) -> Option<&'s str> { | ||||
|         todo!() | ||||
|         None | ||||
|     } | ||||
| 
 | ||||
|     fn get_post_blank(&self) -> PostBlank { | ||||
|         todo!() | ||||
|         self.post_blank | ||||
|             .map(|text| text.chars().count()) | ||||
|             .unwrap_or(0) | ||||
|             .try_into() | ||||
|             .expect("Too much post-blank to fit into a PostBlank.") | ||||
|     } | ||||
| } | ||||
| 
 | ||||
|  | ||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user
	 Tom Alexander
						Tom Alexander