Why does Discourse sometimes add extra blank lines to my posts?

Further to my previous post, I don’t know if this is related, but many of the emails from Discourse have extraneous Ctrl-M carriage returns in them. I get them from many other posters, but here is an example of mine from the same topic referenced in my previous post:

The extra Ctrl-M chars don’t seem to effect either the formatted or raw post in the web UI, but believe me, they are very obvious (and annoying) in a console text interface mail client like mutt.

Please don’t tell me to use a better email client :frowning_face: Although I will be happy if other mutt users can suggest a config that will hide the visible ^M chars in the email :grinning:

In this case, the Ctrl-M characters seem to be associated with the presence of non-ASCII characters. In this thread, I see that every post (not just mine) sent with Content-Transfer-Encoding: quoted-printable appears with extraneous Ctrl-M chars inserted between lines, while those very few with sent with Content-Transfer-Encoding: 7bit appear correctly.

Note that unlike the extra blank lines issue, this one appears to affect almost all users not just me. (Although maybe other email clients hide the ^M and so they are unaware of it.)

To summarise:

Emails sent by Discourse appear to have two (related?) bugs:

  • Emails containing non-ASCII chars send as quoted-printable appear to have extraneous ^M carriage returns added.
  • Emails originally sent by me, and then processed and resent by Discourse, sometimes but not always have extra blank lines inserted between paragraphs (but not always).

(I should comment that I’ve been using mutt for approaching twenty years, and I receive tons of emails from all sorts of mail clients, mailing lists, and other software, and have never seen either of these behaviours before. This makes me reasonably confident that it is a Discourse issue.)