Implement the new fields for plain link.
This commit is contained in:
		
							parent
							
								
									13c62bf29f
								
							
						
					
					
						commit
						4753f4c7c6
					
				| @ -54,7 +54,7 @@ pub(crate) fn plain_link<'b, 'g, 'r, 's>( | ||||
|     let (remaining, _) = pre(context, input)?; | ||||
|     let (remaining, path_plain) = parse_path_plain(context, remaining)?; | ||||
|     peek(parser_with_context!(post)(context))(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); | ||||
|     Ok(( | ||||
| @ -66,6 +66,7 @@ pub(crate) fn plain_link<'b, 'g, 'r, 's>( | ||||
|             raw_link: path_plain.raw_link, | ||||
|             search_option: path_plain.search_option, | ||||
|             application: path_plain.application, | ||||
|             post_blank: post_blank.map(Into::<&str>::into), | ||||
|         }, | ||||
|     )) | ||||
| } | ||||
|  | ||||
| @ -139,6 +139,7 @@ pub struct PlainLink<'s> { | ||||
|     pub raw_link: &'s str, | ||||
|     pub search_option: Option<&'s str>, | ||||
|     pub application: Option<&'s str>, | ||||
|     pub post_blank: Option<&'s str>, | ||||
| } | ||||
| 
 | ||||
| #[derive(Debug)] | ||||
| @ -702,11 +703,15 @@ impl<'s> StandardProperties<'s> for PlainLink<'s> { | ||||
|     } | ||||
| 
 | ||||
|     fn get_contents<'b>(&'b self) -> Option<&'s str> { | ||||
|         todo!() | ||||
|         None | ||||
|     } | ||||
| 
 | ||||
|     fn get_post_blank(&self) -> PostBlank { | ||||
|         todo!() | ||||
|         self.post_blank | ||||
|             .map(|post_blank| post_blank.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