Implement the new fields for target.

This commit is contained in:
Tom Alexander
2023-12-15 18:57:19 -05:00
parent 33ca43ca40
commit 6b802d36bf
3 changed files with 12 additions and 3 deletions

View File

@@ -266,6 +266,7 @@ pub struct LineBreak<'s> {
pub struct Target<'s> {
pub source: &'s str,
pub value: &'s str,
pub post_blank: Option<&'s str>,
}
#[derive(Debug)]
@@ -923,11 +924,15 @@ impl<'s> StandardProperties<'s> for Target<'s> {
}
fn get_contents<'b>(&'b self) -> Option<&'s str> {
todo!()
None
}
fn get_post_blank(&self) -> PostBlank {
todo!()
self.post_blank
.map(|post_blank| post_blank.chars().count())
.unwrap_or(0)
.try_into()
.expect("Too much post-blank to fit into a PostBlank.")
}
}