Open andreip opened 7 years ago
Thanks for reporting this, that's a bug!
If you want to investigate and submit a PR, feel free to do so. Otherwise, I'll take a look at it when I get a chance.
While working on this it's also worth taking a look at https://github.com/closeio/quotequail/issues/22
First, thanks for the great library!
I'm getting into a case where the
unwrap_html
includeshtml_top
field and the value of it is pretty much all the html when I provide it with a forward message that doesn't contain any message above the----Forward message----
pattern. In comparison, theunwrap
function doesn't include thetext_top
if you give it the plain text version of the same email. See some tests you can add and see this pass/fail in actual repo.A test example that would pass
Adding a similar test to
UnwrapTestCase.test_gmail_forward
, but without the "Hello" message at the beginning:and this passes just fine, since
unwrap
doesn't includetext_top
in the output when there's no message at the top.A test example that would fail
Adding a similar test to
HTMLUnwrapTestCase.test_gmail_forward
, but without the text at the top again:and this fails, since
unwrap_html
also includes ahtml_top
field in the output. And the value of thehtml_top
is basically all the email in this case, so not useful:Do you think that it should behave the way I'm suggesting, so not include
html_top
here? In that case I can look into it and provide a PR.Something unrelated to this but I realized I haven't tried making it have an
html_bottom
too, but might not make sense in forward case, only in reply case, right? Since how would you tell if that's the bottom or it's part of the forwarded email itself?