Implement the new fields for subscript and superscript.
This commit is contained in:
@@ -264,6 +264,8 @@ pub struct StatisticsCookie<'s> {
|
||||
pub struct Subscript<'s> {
|
||||
pub source: &'s str,
|
||||
pub use_brackets: bool,
|
||||
pub contents: &'s str,
|
||||
pub post_blank: Option<&'s str>,
|
||||
pub children: Vec<Object<'s>>,
|
||||
}
|
||||
|
||||
@@ -271,6 +273,8 @@ pub struct Subscript<'s> {
|
||||
pub struct Superscript<'s> {
|
||||
pub source: &'s str,
|
||||
pub use_brackets: bool,
|
||||
pub contents: &'s str,
|
||||
pub post_blank: Option<&'s str>,
|
||||
pub children: Vec<Object<'s>>,
|
||||
}
|
||||
|
||||
@@ -883,11 +887,15 @@ impl<'s> StandardProperties<'s> for Subscript<'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.")
|
||||
}
|
||||
}
|
||||
|
||||
@@ -897,11 +905,15 @@ impl<'s> StandardProperties<'s> for Superscript<'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.")
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user