32 lines
728 B
Rust
32 lines
728 B
Rust
use serde::Serialize;
|
|
|
|
use super::render_context::RenderContext;
|
|
use crate::error::CustomError;
|
|
use crate::intermediate::IItalic;
|
|
|
|
use super::macros::render;
|
|
use super::RenderObject;
|
|
|
|
#[derive(Debug, Serialize)]
|
|
#[serde(tag = "type")]
|
|
#[serde(rename = "italic")]
|
|
pub(crate) struct RenderItalic {
|
|
children: Vec<RenderObject>,
|
|
post_blank: organic::types::PostBlank,
|
|
}
|
|
|
|
render!(RenderItalic, IItalic, original, render_context, {
|
|
let children = {
|
|
let mut ret = Vec::new();
|
|
for obj in original.children.iter() {
|
|
ret.push(RenderObject::new(render_context.clone(), obj)?);
|
|
}
|
|
ret
|
|
};
|
|
|
|
Ok(RenderItalic {
|
|
children,
|
|
post_blank: original.post_blank,
|
|
})
|
|
});
|