Add support for plain links.
This commit is contained in:
		
							parent
							
								
									eb67327574
								
							
						
					
					
						commit
						cb5d131097
					
				| @ -1 +1 @@ | ||||
| !!!!!!!! plain_link | ||||
| <a href="{.raw_link}">{.raw_link}</a> | ||||
|  | ||||
| @ -1,16 +1,21 @@ | ||||
| use serde::Serialize; | ||||
| 
 | ||||
| use super::macros::render; | ||||
| use super::render_context::RenderContext; | ||||
| use crate::error::CustomError; | ||||
| use crate::intermediate::IPlainLink; | ||||
| 
 | ||||
| use super::macros::rnoop; | ||||
| 
 | ||||
| #[derive(Debug, Serialize)] | ||||
| #[serde(tag = "type")] | ||||
| #[serde(rename = "plain_link")] | ||||
| pub(crate) struct RenderPlainLink { | ||||
|     raw_link: String, | ||||
|     post_blank: organic::types::PostBlank, | ||||
| } | ||||
| 
 | ||||
| rnoop!(RenderPlainLink, IPlainLink); | ||||
| render!(RenderPlainLink, IPlainLink, original, _render_context, { | ||||
|     Ok(RenderPlainLink { | ||||
|         raw_link: original.raw_link.clone(), | ||||
|         post_blank: original.post_blank, | ||||
|     }) | ||||
| }); | ||||
|  | ||||
| @ -1,5 +1,22 @@ | ||||
| use super::macros::inoop; | ||||
| use super::macros::intermediate; | ||||
| use crate::error::CustomError; | ||||
| use organic::types::StandardProperties; | ||||
| 
 | ||||
| inoop!(IPlainLink, PlainLink); | ||||
| #[derive(Debug, Clone)] | ||||
| pub(crate) struct IPlainLink { | ||||
|     pub(crate) raw_link: String, | ||||
|     pub(crate) post_blank: organic::types::PostBlank, | ||||
| } | ||||
| 
 | ||||
| intermediate!( | ||||
|     IPlainLink, | ||||
|     &'orig organic::types::PlainLink<'parse>, | ||||
|     original, | ||||
|     _intermediate_context, | ||||
|     { | ||||
|         Ok(IPlainLink { | ||||
|             raw_link: original.raw_link.to_owned(), | ||||
|             post_blank: original.get_post_blank(), | ||||
|         }) | ||||
|     } | ||||
| ); | ||||
|  | ||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user
	 Tom Alexander
						Tom Alexander