diff --git a/Parsedown.php b/Parsedown.php
index <HASH>..<HASH> 100755
--- a/Parsedown.php
+++ b/Parsedown.php
@@ -78,7 +78,7 @@ class Parsedown
 		# ~ 
 		
 		$text = preg_replace('/\n\s*\n/', "\n\n", $text);
-		$text = trim($text, "\n");
+		$text = trim($text, "\n ");
 		
 		$lines = explode("\n", $text);
error when last line consists of 1-3 spaces