From 04ee58bb9ec1e89b3f09f96f446290aef7584703 Mon Sep 17 00:00:00 2001 From: Abimael Martell Date: Sat, 7 Feb 2026 13:37:51 -0800 Subject: [PATCH] Trim leading and trailing whitespace from markdown output Co-Authored-By: Claude Opus 4.5 --- src/markdown.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/markdown.rs b/src/markdown.rs index 577dab8..d10d25b 100644 --- a/src/markdown.rs +++ b/src/markdown.rs @@ -367,8 +367,8 @@ fn clean_markdown(mut text: String) -> String { text = text.replace("\n\n\n", "\n\n"); } - // Ensure ends with single newline - text = text.trim_end().to_string(); + // Trim leading and trailing whitespace, ensure ends with single newline + text = text.trim().to_string(); text.push('\n'); text