fix simple trailing whitespace

fixes #742

https://bugs.ruby-lang.org/issues/7175

@bf4 @jeremy 
so change the it to only match =+newline ?


On Sun, Jul 27, 2014 at 9:20 AM, Jeremy Kemper <notifications@github.com>
wrote:

> In spec/mail/encodings/quoted_printable_spec.rb:
>
> >    it "should decode quoted printable text" do
> >      result = "\000\000\000\000"
> > -    expect(Mail::Encodings::QuotedPrintable.decode("=00=00=00=00")).to eq result
> > +    expect(decode("=00=00=00=00")).to eq result
> > +  end
> > +
> > +  # https://bugs.ruby-lang.org/issues/7175
> > +  it "should remove trailing equal" do
> > +    expect(utf8(decode("t=C3=A5=E2=88=82=C6=92t="))).to eq "tå∂ƒt"
> >    end
>
> https://bugs.ruby-lang.org/issues/7175 trailing = is not standard compliant, but it's common in practice
>
> This comment is inline with the code. The test is still "explained" by a
> bare URL about a Ruby behavior change. The linked URL gives a hint about
> why you made the PR. It doesn't really explain why we're stripping the
> equal sign.
>
>    1.
>
>    The trailing equals is neither standard compliant nor non-compliant.
>    It's ambiguous. This PR is making a behavior change to strip the equals and
>    resolve the ambiguity. It was caused by Ruby changing to pass through the
>    equals, causing a regression for us since we implicitly relied on its old
>    behavior.
>     2.
>
>    Trailing equals with no newline is not common in practice. Older
>    versions of the mail lib stripped the body before decoding, causing this
>    problem. It's much rarer to see a message actually arrive with malformed
>    encoding.
>
> —
> Reply to this email directly or view it on GitHub
> <https://github.com/mikel/mail/pull/753/files#r15440101>.
>