Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorhttp://jneen.net/ <jneen@jneen.net>2016-11-15 10:58:37 +0300
committerhttp://jneen.net/ <jneen@jneen.net>2016-12-21 20:51:41 +0300
commit03753ff146a448eb66e7af12f56dcc4cf11922d9 (patch)
treec12a6dde6115d81cd207aa16b79bc1b420042572 /lib/gitlab/email
parenta3bb2463c41124d6d7f5927bbff578a4991c15cb (diff)
remove trailing whitespace from email bodies
Diffstat (limited to 'lib/gitlab/email')
-rw-r--r--lib/gitlab/email/reply_parser.rb3
1 files changed, 3 insertions, 0 deletions
diff --git a/lib/gitlab/email/reply_parser.rb b/lib/gitlab/email/reply_parser.rb
index e53a99cd8e0..ed8c1cd09f8 100644
--- a/lib/gitlab/email/reply_parser.rb
+++ b/lib/gitlab/email/reply_parser.rb
@@ -15,6 +15,9 @@ module Gitlab
body = EmailReplyTrimmer.trim(body)
+ # [jneen] not using /\s+$/ here because that deletes empty lines
+ body = body.gsub(/[ \t]$/, '')
+
# TODO [jneen]: do we want to allow empty-quoting? (replies only containing a blockquote)
# EmailReplyTrimmer allows this as a special case, so we detect it manually here.
return "" if body.lines.all? { |l| l.strip.empty? || l.start_with?('>') }