Implement the new fields for dynamic block.

This commit is contained in:
Tom Alexander
2023-12-15 17:26:01 -05:00
parent 565978225a
commit eba4fb94cf
3 changed files with 30 additions and 18 deletions

View File

@@ -87,6 +87,8 @@ pub struct DynamicBlock<'s> {
pub block_name: &'s str,
pub parameters: Option<&'s str>,
pub children: Vec<Element<'s>>,
pub contents: Option<&'s str>,
pub post_blank: Option<&'s str>,
}
#[derive(Debug)]
@@ -243,11 +245,15 @@ impl<'s> StandardProperties<'s> for DynamicBlock<'s> {
}
fn get_contents<'b>(&'b self) -> Option<&'s str> {
todo!()
self.contents
}
fn get_post_blank(&self) -> PostBlank {
todo!()
self.post_blank
.map(|text| text.lines().count())
.unwrap_or(0)
.try_into()
.expect("Too much post-blank to fit into a PostBlank.")
}
}