From: Scott Worley Date: Thu, 26 Sep 2024 03:56:52 +0000 (-0700) Subject: Double blank lines in the input generate spacer rows X-Git-Tag: v0.3.0~4 X-Git-Url: http://git.scottworley.com/tablify/commitdiff_plain/14a039db4c850c41ca1cd72c692afe59d6d1347b?ds=inline;hp=722ea29747d6e820490db0bf988cda86c3341565 Double blank lines in the input generate spacer rows --- 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(),