mhonarc-users

Re: Word wrapping messages

2005-04-28 13:56:26
On April 28, 2005 at 11:02, East Coast Coder wrote:

Many MUA's insert newlines after every 80 chars.  Now, when the
message gets converted by MHonArc into HTML, these are stored as
<br>'s - hence, we have an HTML message wrapped after every 80 chars.

You are still mixing two things.  The email is _not_ an HTML message:
it is a plain text message.  During archiving by mhonarc, the semantics
of plain text is preserved, hence the <br>'s.

If the email was authored as an HTML message (i.e. content-type of
text/html), then mhonarc does not put in <br>'s.  There is nothing
in mhonarc's HTML filter code that even has the string "<br>".

Therefore, you must be refering to how mhonarc converts text/plain
messages, NOT text/html messages.  Since you also refer to the
existence of <br>'s, then you have changed the default behavior
of the text/plain filter (m2h_text_plain::filter).

By default, the filter uses a PRE element for rendering the textual
data with _no_ <br>'s added -- since they are not needed.  The
true semantics of a text/plain message (excluding format=flowed types)
is to render the text as-is.

Since you mention <br>'s, I would guess that you have specified
the "nonfixed" option to m2h_text_plain::filter.  In this case,
you are explicitly overriding some of the semantics of text/plain
(i.e. do not user a fixed-width font to render text).  However,
mhonarc attempts to preserve all other semantics, like line breaks
(hence the existence of <br>'s).

If you want to avoid the confusing wrapping, then add the
keepspace option to m2h_text_plain::filter.  This way, lines will
not get wrapped if the HTML window is reduced, always preserving
the original line semantics of the email message.

However, HTML UA's (that is, browsers) handle line wrapping
automatically - as the user likes it.  The user can squeeze the window
less than 80, in which case the br's will annoyinngly fall midline -
or he can make it much wider (for a wide screen, or to print) - except
that the br's will prevent this.

_NO_ HTML browser will auto-wrap lines in a PRE element unless
explicitly specified via a stylesheet.  Mhonarc, by default, uses
the PRE element to wrap plain text messages.  Have you defined options
to the m2h_text_plain::filter that changes this behavior?  If so, this
may be the source of your confusion.

This is one of the founding principles of HTML: encode only content
and structure, and allow the UA to handle as much of the formatting as
possible.  In general, it works quite well, and I think in this case,
MHonArc would benefit.

I think you are confusing various concepts.  I'm well aware of how
HTML works.  I think you are not clear on how email works, especially
the role of media-types (aka content-types) and mhonarc's preservation
of the their semantics.

You may want to read RFC 2646, especially section 3.

--ewh

<Prev in Thread] Current Thread [Next in Thread>