# Email-in containing \<br\>\</b\>

**URL:** <https://meta.discourse.org/t/email-in-containing-br-b/67342>\
**Category:** Bug\
**Created:** [August 2, 2017, 8:22pm UTC](https://meta.discourse.org/t/email-in-containing-br-b/67342 "2017-08-02T20:22:17Z")\
**Posts on this page:** 1\
**Showing post:** 1

<div class="post-metadata">

**Author:** ![LeoMcA](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/leomca/32/87233_2.png) [@LeoMcA](https://meta.discourse.org/u/LeoMcA)\
**Post date:** [August 2, 2017, 8:22pm UTC](https://meta.discourse.org/t/email-in-containing-br-b/67342/1 "2017-08-02T20:22:18Z")

</div>

We’ve run into this annoying bug a number of times on [discourse.mozilla.org](http://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`:

```plaintext
**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](https://github.com/discourse/discourse/pull/5022)

@zogstrip this is your area of expertise, right?

---

_[View the full topic](https://meta.discourse.org/t/email-in-containing-br-b/67342)._
