Implement the new fields for subscript and superscript.
Some checks failed
clippy Build clippy has failed
rust-foreign-document-test Build rust-foreign-document-test has failed
rust-build Build rust-build has succeeded
rust-test Build rust-test has failed

This commit is contained in:
Tom Alexander
2023-12-11 12:04:59 -05:00
parent 50145c6cf2
commit 0108f5b0b1
2 changed files with 46 additions and 21 deletions

View File

@@ -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.")
}
}