Implement the new fields for citation.
This commit is contained in:
@@ -224,6 +224,8 @@ pub struct Citation<'s> {
|
||||
pub prefix: Vec<Object<'s>>,
|
||||
pub suffix: Vec<Object<'s>>,
|
||||
pub children: Vec<CitationReference<'s>>,
|
||||
pub contents: &'s str,
|
||||
pub post_blank: Option<&'s str>,
|
||||
}
|
||||
|
||||
#[derive(Debug)]
|
||||
@@ -832,11 +834,15 @@ impl<'s> StandardProperties<'s> for Citation<'s> {
|
||||
}
|
||||
|
||||
fn get_contents<'b>(&'b self) -> Option<&'s str> {
|
||||
todo!()
|
||||
Some(self.contents)
|
||||
}
|
||||
|
||||
fn get_post_blank(&self) -> PostBlank {
|
||||
todo!()
|
||||
self.post_blank
|
||||
.map(|text| text.chars().count())
|
||||
.unwrap_or(0)
|
||||
.try_into()
|
||||
.expect("Too much post-blank to fit into a PostBlank.")
|
||||
}
|
||||
}
|
||||
|
||||
@@ -846,11 +852,11 @@ impl<'s> StandardProperties<'s> for CitationReference<'s> {
|
||||
}
|
||||
|
||||
fn get_contents<'b>(&'b self) -> Option<&'s str> {
|
||||
todo!()
|
||||
None
|
||||
}
|
||||
|
||||
fn get_post_blank(&self) -> PostBlank {
|
||||
todo!()
|
||||
0
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user