RFC3676 - The Text/Plain Format and DelSp Parameters

2004-04-04 10:49:21
I thought I had sent this a while ago, but I couldn't find it in the archive, so
here it is again:

Ken Hirsch

There is a revision to RFC 2646

"The Text/Plain Format and DelSp Parameters". It adds an extra parameter, 
Delsp, to
Content-type: text/plain.

The parameter is added to facilitate non-Western languages where there
may be paragraphs that need to be flowed, but don't have ASCII spaces. The idea 
that if Delsp=Yes, then you delete _one_ space from then end of the line before
flowing them together.  If Delsp=No, the default for backward-compatibility, you
would treat it as format=flowed is treated now.

Apple Mail is already using this, and you can find examples if you google
for "Delsp=Yes"

So, a sentence like
Now is the time for all good men to come to the aid of their country.

Could be put into email as
(Where "*" is for a trailing space)

Format=flowed; Delsp=No
Now is the time*
nfor all good men*
to come to the aid*
of their country.

Format=flowed; Delsp=Yes
Now is the time**
for all good men**
to come to the aid**
of their country.

or even
Format=flowed; Delsp=Yes
Now is the time**
for all go*
od men* to co*
me to the aid**
of their country.

And these should all be displayed the same.

In the current code, the property of HTML displaying any consecutive
white space as a single space is relied upon and new-line characters are
not removed.

Here are some possible changes to (none tested!!)

Assuming that $delsp has been set to true if the Delsp=Yes parameter is

After this line (about line 393 of
      $para =~ s/^(|.*[^ ])(\n)(?!\Z)/
          ($keepspace ? &preserve_space($1) : $1) .

# Either do all lines
if ($delsp) {
  $para =~ s/ \n//mg;

# or maybe just do lines with only one trailing space:
if ($delsp) {
  $para =~ s/(\S) \n/$1/mg;

# or even do this to help keep HTML source lines short:
if ($delsp) {
  $para =~ s/(\S) \n/$1<!--\n-->/mg;

To sign-off this list, send email to majordomo(_at_)mhonarc(_dot_)org with the

<Prev in Thread] Current Thread [Next in Thread>
  • RFC3676 - The Text/Plain Format and DelSp Parameters, Ken Hirsch <=