From 14a039db4c850c41ca1cd72c692afe59d6d1347b Mon Sep 17 00:00:00 2001 From: Scott Worley Date: Wed, 25 Sep 2024 20:56:52 -0700 Subject: [PATCH] Double blank lines in the input generate spacer rows --- Changelog | 1 + src/lib.rs | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/Changelog b/Changelog index 6f09172..7158f63 100644 --- a/Changelog +++ b/Changelog @@ -3,6 +3,7 @@ - Escape HTML characters properly - Fix an unnecessary O(n^2)ism - Rare events appear as end-of-line notes rather than mostly-empty columns +- Double blank line for small break between rows ## [0.2.1] - 2024-08-20 - A little more space up top diff --git a/src/lib.rs b/src/lib.rs index e11f08b..744dc66 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -138,7 +138,7 @@ impl>> Iterator for Reader InputLine::Blank if self.row.is_some() => { return Ok(std::mem::take(&mut self.row).map(Rowlike::Row)).transpose() } - InputLine::Blank => {} + InputLine::Blank => return Some(Ok(Rowlike::Spacer)), InputLine::Entry(col, instance) => match &mut self.row { None => { return Some(Err(std::io::Error::other(format!( @@ -419,6 +419,7 @@ mod tests { label: "foo".to_owned(), entries: HashMap::new(), }), + Rowlike::Spacer, Rowlike::Row(Row { label: "bar".to_owned(), entries: HashMap::new(), -- 2.44.1