]> git.scottworley.com Git - tablify/commitdiff
Double blank lines in the input generate spacer rows
authorScott Worley <scottworley@scottworley.com>
Thu, 26 Sep 2024 03:56:52 +0000 (20:56 -0700)
committerScott Worley <scottworley@scottworley.com>
Wed, 2 Oct 2024 09:40:47 +0000 (02:40 -0700)
Changelog
src/lib.rs

index 6f091727ad19b94c3d79fe4c3e56a9d2f331c8df..7158f6361da7d3d42a3089aa2d62c68763db6935 100644 (file)
--- 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
index e11f08b7f623f921b4df1ead0f429d318c7f6219..744dc66d5dd9d478ddb73fb7e9b88af01ba32129 100644 (file)
@@ -138,7 +138,7 @@ impl<Input: Iterator<Item = Result<String, std::io::Error>>> 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(),