]> git.cworth.org Git - sup/commitdiff
re-fix Text to truncate any penultimate blank lines
authorwmorgan <wmorgan@5c8cc53c-5e98-4d25-b20a-d8db53a31250>
Wed, 14 Nov 2007 17:25:03 +0000 (17:25 +0000)
committerwmorgan <wmorgan@5c8cc53c-5e98-4d25-b20a-d8db53a31250>
Wed, 14 Nov 2007 17:25:03 +0000 (17:25 +0000)
git-svn-id: svn://rubyforge.org/var/svn/sup/trunk@704 5c8cc53c-5e98-4d25-b20a-d8db53a31250

lib/sup/message-chunks.rb

index 0f7b38f5e10e3c53f700e279159360de5acb2563..d243cdaf7d6b07a70925667f9383b76981e6db33 100644 (file)
@@ -111,7 +111,7 @@ EOS
       @lines = lines.map { |l| l.chomp.wrap WRAP_LEN }.flatten # wrap
 
       ## trim off all empty lines except one
-      @lines.pop while @lines.last =~ /^\s*$/ 
+      @lines.pop while @lines.length > 1 && @lines[-1] =~ /^\s*$/ && @lines[-2] =~ /^\s*$/
     end
 
     def inlineable?; true end