Commit 03753ff1 authored by http://jneen.net/'s avatar http://jneen.net/

remove trailing whitespace from email bodies

parent a3bb2463
...@@ -15,6 +15,9 @@ module Gitlab ...@@ -15,6 +15,9 @@ module Gitlab
body = EmailReplyTrimmer.trim(body) 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) # 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. # 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?('>') } return "" if body.lines.all? { |l| l.strip.empty? || l.start_with?('>') }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment