remove trailing whitespace from email bodies
This commit is contained in:
parent
a3bb2463c4
commit
03753ff146
2 changed files with 4 additions and 1 deletions
|
@ -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?('>') }
|
||||
|
|
|
@ -156,7 +156,7 @@ describe Gitlab::Email::ReplyParser, lib: true do
|
|||
<<-BODY.strip_heredoc.chomp
|
||||
### this is a reply from iOS default mail
|
||||
|
||||
The quick brown fox jumps over the lazy dog. The quick brown fox jumps over the lazy dog. The quick brown fox jumps over the lazy dog. The quick brown fox jumps over the lazy dog. The quick brown fox jumps over the lazy dog. The quick brown fox jumps over the lazy dog. The quick brown fox jumps over the lazy dog.
|
||||
The quick brown fox jumps over the lazy dog. The quick brown fox jumps over the lazy dog. The quick brown fox jumps over the lazy dog. The quick brown fox jumps over the lazy dog. The quick brown fox jumps over the lazy dog. The quick brown fox jumps over the lazy dog. The quick brown fox jumps over the lazy dog.
|
||||
|
||||
Here's some **bold** markdown text.
|
||||
|
||||
|
|
Loading…
Reference in a new issue