Idiomdrottning’s homepage

RFC 2646’s Format=Flowed and inline quoting

According to RFC 2646, email apps should:

Space-stuff lines which start with a space, “From ”, or “>”.

So I’m gonna argue against an RFC should here.

The intent behind this particular should is to prevent lines that normally start with a greater-than character to be misinterpreted as if they were quote characters. I’m hard pressed to come up with even one example but I’m sure there are some math situation or something where it could conceivably come up.

The intent behind the RFC was that there should be some sort of UI widget to explicitly mark text as “quoted”, that you’d do that through selecting text and hitting a button or menu item, not by manually inserting > characters. But GUI text-formatting has been taking a step back these days in favor of markdown.

My recommendation is that MUAs (including webmail interfaces) should not space-stuff lines that start with a “>” character, and if there is a line that starts with “ >” (a single space in front of the >), leave those alone too.

That way, if math nerds want to send non-quoted lines that do start with a >, they still can, they just add a space in front of them manually.

Still space stuff lines that start with “From ”, and lines (other than “ >”) that start with a space.

Format=Flowed is otherwise a fantastic format. It solves a lot of email’s problems. The next section (4.2) in the RFC is still great. Non–space-stuffed lines starting with a > are marked as quoted. Perfect, that’s exactly what we want. In other words, I am not suggesting changing the format or the on-the-wire protocol. I’m only talking about a way to make generating this format more palatable for text area based interfaces.

Email is a text format and having to reach for a formatting menu or toolbar just to mark some text as quoted falls apart pretty quickly, as does trying to interleave your own responses in between the quoted lines. Those interfaces work for top-posting and bottom-posting, and that’s great, but they make inline-posting impossible.

Markdown to Format=Flowed

There are some variants of markdown where every linebreak is hard, but in original markdown you mark hard linebreaks with two spaces at the end of the line (before the break), and blank lines are also hard.

Format=Flowed is the other way around. Soft linebreaks are marked with a single space at the end of the line, before the break.

Therefore, to convert, one way is to add a space to the end of every line, then remove three spaces from lines that now have three spaces, then remove one space from lines that only contain that space and nothing else, then remove one space from lines before a blank line.

Another way to do it is go from top to bottom; if there are two spaces, just remove them, otherwise, if there is text (the line is non-blank) on both the current and the next line, add one space to the current line.