natter/src/intermediate/paragraph.rs

32 lines
753 B
Rust
Raw Normal View History

use super::macros::intermediate;
2023-10-27 15:46:16 -04:00
use super::IObject;
use crate::error::CustomError;
2023-12-21 14:56:58 -05:00
use organic::types::StandardProperties;
2023-10-27 15:46:16 -04:00
2023-10-29 15:36:15 -04:00
#[derive(Debug, Clone)]
2023-10-27 15:46:16 -04:00
pub(crate) struct IParagraph {
pub(crate) children: Vec<IObject>,
2023-12-21 14:56:58 -05:00
pub(crate) post_blank: organic::types::PostBlank,
2023-10-27 15:46:16 -04:00
}
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
};
2023-10-27 15:46:16 -04:00
2023-12-21 14:56:58 -05:00
Ok(IParagraph {
children,
post_blank: original.get_post_blank(),
})
}
);