Trim leading and trailing whitespace from markdown output

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
Abimael Martell
2026-02-07 13:37:51 -08:00
co-authored by Claude Opus 4.5
parent c14e26495d
commit 04ee58bb9e
+2 -2
View File
@@ -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