diff options
author | http://jneen.net/ <jneen@jneen.net> | 2016-11-15 10:58:37 +0300 |
---|---|---|
committer | http://jneen.net/ <jneen@jneen.net> | 2016-12-21 20:51:41 +0300 |
commit | 03753ff146a448eb66e7af12f56dcc4cf11922d9 (patch) | |
tree | c12a6dde6115d81cd207aa16b79bc1b420042572 /lib/gitlab/email | |
parent | a3bb2463c41124d6d7f5927bbff578a4991c15cb (diff) |
remove trailing whitespace from email bodies
Diffstat (limited to 'lib/gitlab/email')
-rw-r--r-- | lib/gitlab/email/reply_parser.rb | 3 |
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?('>') } |