Implement the new fields for property drawer.

This commit is contained in:
Tom Alexander
2023-12-15 13:03:42 -05:00
parent 57f566a7a1
commit bb472b63cc
2 changed files with 29 additions and 8 deletions

View File

@@ -103,6 +103,8 @@ pub struct Drawer<'s> {
pub struct PropertyDrawer<'s> {
pub source: &'s str,
pub children: Vec<NodeProperty<'s>>,
pub contents: Option<&'s str>,
pub post_blank: Option<&'s str>,
}
#[derive(Debug)]
@@ -258,11 +260,15 @@ impl<'s> StandardProperties<'s> for PropertyDrawer<'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.")
}
}