We’ve run into this annoying bug a number of times on discourse.mozilla.org, where users will send an email to Discourse and half of the email will go missing for no apparent reason.
The reason is, as it turns out, because whatever email client they’re using has generated html along the lines of this: <b>Some bold text<br></b>
.
In lib/email/reciever.rb
this html is then turned into this markdown by HtmlToMarkdown
:
**Some bold text
**
Then EmailReplyTrimmer
comes along, sees **
as a delimiter between body and footer of email, and removes it and everything below it.
I would say the bug here exists in HtmlToMarkdown
since the markdown it’s generating isn’t valid:
**Oops
**
So I’ve had a crack at fixing that here:
https://github.com/discourse/discourse/pull/5022
@zogstrip this is your area of expertise, right?