Add intermediate stage for text markup.
This commit is contained in:
		
							parent
							
								
									ae933b491e
								
							
						
					
					
						commit
						0fae417610
					
				| @ -1 +1 @@ | ||||
| <code>{.source}</code> | ||||
| <code>{.contents}</code> | ||||
|  | ||||
| @ -1 +1 @@ | ||||
| <code>{.source}</code> | ||||
| <code>{.contents}</code> | ||||
|  | ||||
| @ -1,5 +1,21 @@ | ||||
| use super::macros::inoop; | ||||
| use super::macros::intermediate; | ||||
| use super::IObject; | ||||
| 
 | ||||
| use crate::error::CustomError; | ||||
| 
 | ||||
| inoop!(IBold, Bold); | ||||
| #[derive(Debug, Clone)] | ||||
| pub(crate) struct IBold { | ||||
|     pub(crate) children: Vec<IObject>, | ||||
| } | ||||
| 
 | ||||
| intermediate!(IBold, Bold, original, registry, { | ||||
|     let children = { | ||||
|         let mut ret = Vec::new(); | ||||
|         for obj in original.children.iter() { | ||||
|             ret.push(IObject::new(registry.clone(), obj).await?); | ||||
|         } | ||||
|         ret | ||||
|     }; | ||||
| 
 | ||||
|     Ok(IBold { children }) | ||||
| }); | ||||
|  | ||||
| @ -1,5 +1,15 @@ | ||||
| use super::macros::inoop; | ||||
| use super::macros::intermediate; | ||||
| 
 | ||||
| use crate::error::CustomError; | ||||
| 
 | ||||
| inoop!(ICode, Code); | ||||
| #[derive(Debug, Clone)] | ||||
| pub(crate) struct ICode { | ||||
|     pub(crate) contents: String, | ||||
| } | ||||
| 
 | ||||
| intermediate!(ICode, Code, original, _registry, { | ||||
|     Ok(ICode { | ||||
|         // TODO: Should this coalesce whitespace like PlainText?
 | ||||
|         contents: original.contents.to_owned(), | ||||
|     }) | ||||
| }); | ||||
|  | ||||
| @ -1,5 +1,21 @@ | ||||
| use super::macros::inoop; | ||||
| use super::macros::intermediate; | ||||
| use super::IObject; | ||||
| 
 | ||||
| use crate::error::CustomError; | ||||
| 
 | ||||
| inoop!(IItalic, Italic); | ||||
| #[derive(Debug, Clone)] | ||||
| pub(crate) struct IItalic { | ||||
|     pub(crate) children: Vec<IObject>, | ||||
| } | ||||
| 
 | ||||
| intermediate!(IItalic, Italic, original, registry, { | ||||
|     let children = { | ||||
|         let mut ret = Vec::new(); | ||||
|         for obj in original.children.iter() { | ||||
|             ret.push(IObject::new(registry.clone(), obj).await?); | ||||
|         } | ||||
|         ret | ||||
|     }; | ||||
| 
 | ||||
|     Ok(IItalic { children }) | ||||
| }); | ||||
|  | ||||
| @ -1,5 +1,21 @@ | ||||
| use super::macros::inoop; | ||||
| use super::macros::intermediate; | ||||
| use super::IObject; | ||||
| 
 | ||||
| use crate::error::CustomError; | ||||
| 
 | ||||
| inoop!(IStrikeThrough, StrikeThrough); | ||||
| #[derive(Debug, Clone)] | ||||
| pub(crate) struct IStrikeThrough { | ||||
|     pub(crate) children: Vec<IObject>, | ||||
| } | ||||
| 
 | ||||
| intermediate!(IStrikeThrough, StrikeThrough, original, registry, { | ||||
|     let children = { | ||||
|         let mut ret = Vec::new(); | ||||
|         for obj in original.children.iter() { | ||||
|             ret.push(IObject::new(registry.clone(), obj).await?); | ||||
|         } | ||||
|         ret | ||||
|     }; | ||||
| 
 | ||||
|     Ok(IStrikeThrough { children }) | ||||
| }); | ||||
|  | ||||
| @ -1,6 +1,21 @@ | ||||
| use super::macros::intermediate; | ||||
| use super::IObject; | ||||
| 
 | ||||
| use crate::error::CustomError; | ||||
| 
 | ||||
| use super::macros::inoop; | ||||
| #[derive(Debug, Clone)] | ||||
| pub(crate) struct IUnderline { | ||||
|     pub(crate) children: Vec<IObject>, | ||||
| } | ||||
| 
 | ||||
| intermediate!(IUnderline, Underline, original, registry, { | ||||
|     let children = { | ||||
|         let mut ret = Vec::new(); | ||||
|         for obj in original.children.iter() { | ||||
|             ret.push(IObject::new(registry.clone(), obj).await?); | ||||
|         } | ||||
|         ret | ||||
|     }; | ||||
| 
 | ||||
| inoop!(IUnderline, Underline); | ||||
|     Ok(IUnderline { children }) | ||||
| }); | ||||
|  | ||||
| @ -1,6 +1,15 @@ | ||||
| use super::macros::intermediate; | ||||
| 
 | ||||
| use crate::error::CustomError; | ||||
| 
 | ||||
| use super::macros::inoop; | ||||
| #[derive(Debug, Clone)] | ||||
| pub(crate) struct IVerbatim { | ||||
|     pub(crate) contents: String, | ||||
| } | ||||
| 
 | ||||
| 
 | ||||
| inoop!(IVerbatim, Verbatim); | ||||
| intermediate!(IVerbatim, Verbatim, original, _registry, { | ||||
|     Ok(IVerbatim { | ||||
|         // TODO: Should this coalesce whitespace like PlainText?
 | ||||
|         contents: original.contents.to_owned(), | ||||
|     }) | ||||
| }); | ||||
|  | ||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user
	 Tom Alexander
						Tom Alexander