Fix post blank for comment.
This commit is contained in:
@@ -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.")
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user