45 lines
1.1 KiB
Rust
45 lines
1.1 KiB
Rust
use super::macros::intermediate;
|
|
use super::IObject;
|
|
use crate::error::CustomError;
|
|
use organic::types::StandardProperties;
|
|
|
|
#[derive(Debug, Clone)]
|
|
pub(crate) struct IParagraph {
|
|
pub(crate) children: Vec<IObject>,
|
|
pub(crate) post_blank: organic::types::PostBlank,
|
|
}
|
|
|
|
intermediate!(
|
|
IParagraph,
|
|
&'orig organic::types::Paragraph<'parse>,
|
|
original,
|
|
intermediate_context,
|
|
{
|
|
let children = {
|
|
let mut ret = Vec::new();
|
|
for obj in original.children.iter() {
|
|
ret.push(IObject::new(intermediate_context.clone(), obj).await?);
|
|
}
|
|
ret
|
|
};
|
|
|
|
Ok(IParagraph {
|
|
children,
|
|
post_blank: original.get_post_blank(),
|
|
})
|
|
}
|
|
);
|
|
|
|
impl IParagraph {
|
|
pub(crate) async fn artificial<'orig, 'parse>(
|
|
_intermediate_context: crate::intermediate::IntermediateContext<'orig, 'parse>,
|
|
children: Vec<IObject>,
|
|
post_blank: organic::types::PostBlank,
|
|
) -> Result<IParagraph, CustomError> {
|
|
Ok(IParagraph {
|
|
children,
|
|
post_blank,
|
|
})
|
|
}
|
|
}
|