Implement the new fields for plain list item.

This commit is contained in:
Tom Alexander
2023-12-15 15:52:53 -05:00
parent 7b88a2d248
commit 022dda06eb
2 changed files with 25 additions and 6 deletions

View File

@@ -35,6 +35,8 @@ pub struct PlainListItem<'s> {
pub tag: Vec<Object<'s>>,
pub pre_blank: PlainListItemPreBlank,
pub children: Vec<Element<'s>>,
pub contents: Option<&'s str>,
pub post_blank: Option<&'s str>,
}
pub type PlainListItemCounter = u16;
@@ -154,11 +156,15 @@ impl<'s> StandardProperties<'s> for PlainListItem<'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.")
}
}