From 8cf3713acd7c44f6851f5c697c8fd972aa45f916 Mon Sep 17 00:00:00 2001 From: Adam Israel Date: Sat, 12 Jul 2025 20:30:57 -0400 Subject: [PATCH] Fix extra newlines I found a case, after removing block comments, that an extra newline could be injected into the compiled manuscript. This will skip blank lines when we're iterating through the content. --- src/markdown.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/markdown.rs b/src/markdown.rs index 7e81b75..70bc19f 100644 --- a/src/markdown.rs +++ b/src/markdown.rs @@ -35,7 +35,8 @@ fn content_to_paragraphs(mut content: String) -> Vec { if content.lines().count() > 0 { content.lines().for_each(|line| { - if !line.is_empty() { + // If the line is empty, skip it. We'll handle line spacing elsewhere. + if !line.trim().is_empty() { // need an "is separator function" if line.trim() == "#" { // This will add the separator for single Markdown documents that explicitly