Implement the new fields for footnote definitions.

This commit is contained in:
Tom Alexander
2023-10-31 23:12:04 -04:00
parent 281c35677b
commit 70002800c2
2 changed files with 13 additions and 3 deletions

View File

@@ -82,6 +82,8 @@ pub struct DynamicBlock<'s> {
#[derive(Debug)]
pub struct FootnoteDefinition<'s> {
pub source: &'s str,
pub contents: Option<&'s str>,
pub post_blank: Option<&'s str>,
pub affiliated_keywords: AffiliatedKeywords<'s>,
pub label: &'s str,
pub children: Vec<Element<'s>>,
@@ -218,11 +220,15 @@ impl<'s> StandardProperties<'s> for FootnoteDefinition<'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.")
}
}