Fix post blank for comment.

This commit is contained in:
Tom Alexander
2023-12-11 12:58:05 -05:00
parent 4af0d3141f
commit 670209e9fc
2 changed files with 8 additions and 2 deletions

View File

@@ -35,6 +35,7 @@ pub struct Paragraph<'s> {
pub struct Comment<'s> {
pub source: &'s str,
pub value: Vec<&'s str>,
pub post_blank: Option<&'s str>,
}
#[derive(Debug)]
@@ -242,7 +243,11 @@ impl<'s> StandardProperties<'s> for Comment<'s> {
}
fn get_post_blank(&self) -> PostBlank {
0
self.post_blank
.map(|text| text.lines().count())
.unwrap_or(0)
.try_into()
.expect("Too much post-blank to fit into a PostBlank.")
}
}