GitHub incorrectly processes incoming text/html email

There seems to be a bug in how GitHub handles incoming emails that are to be added to an issue as a comment.

When incoming mail is sent as:

  • Content-Type: multipart/alternative;

GitHub correctly processes the section for:

  • Content-Type: text/html; charset=utf-8

For example, text enclosed in a blockquote HTML element is correctly formatted: indented, with a bar displayed on the left.

But when it’s sent as simply:

  • Content-Type: text/html; charset=utf-8

GitHub seems to strip out all of the HTML tags, and just show the plain text that was embedded among the HTML.

For example, the blockquote and /blockquote tags are stripped out, but the leading whitespace on each line is preserved.

I confirmed this by sending the exact same message to GitHub (except for changing “Test message” to “Test message 2”) in both formats, and BCC’ing myself. Then I compared the raw text of both emails with a diff tool. One has 2 parts: text/plain and and text/html. The other has only the text/html part. In both cases, the text/html parts are identical (except for changing “Test message” to “Test message 2”).

But GitHub processes the incoming multi-part message correctly and the incoming text/html message wrong.

You can see the correctly and incorrectly formatted comments at: