[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Mixing text and graphics with text/enriched and multipart/mixed



Earlier today, I was debugging a problem where a message was sent with some text and images centered on the same line, but got received with the same images and text split into separate lines. At first, I thought there was a bug in our text/enriched generator or parser, but then I came across this section in RFC1563:
>    [...] Each of these commands  force a line break before and after
>    the formatting environment if there is not otherwise a line break.
>    For example, if one of these commands occurs anywhere other than the
>    beginning of a line of text as presented, a new line is begun.
> 
>       Center -- causes the affected text to be centered.

The only currently "standard" way of mixing rich text and graphics in MIME that I know of is to use an enclosing multipart/mixed containing text/enriched and image/* body parts. However, since each text/enriched part needs to be complete in itself, we need to terminate the <center> directive before adding each image/* part. This, in turn, means that we'll be forcing a newline to be displayed on the receiving end next to each <center> or </center>.

Unless I'm missing something, this is really bad, but I don't see any way around this with the standard as it is today. This and a few other gotchas we've had in the past makes me wonder how many other real implementations of text/enriched there are out there. I suspect not very many. Hopefully, this will all change with emergence of text/html in MIME, though. (Go for it, Jacob!)
Lennart Lövstrand
NeXT Software Engineering