[ mailman-Bugs-2074453 ] allow message display to wrap (simple HTML provided)

SourceForge.net noreply at sourceforge.net
Tue Aug 26 02:32:51 CEST 2008


Bugs item #2074453, was opened at 2008-08-25 14:58
Message generated for change (Comment added) made by msapiro
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=100103&aid=2074453&group_id=103

Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: Web/CGI
Group: 2.1 (stable)
Status: Open
Resolution: None
Priority: 5
Private: No
Submitted By: S Page (skierpage)
Assigned to: Nobody/Anonymous (nobody)
Summary: allow message display to wrap (simple HTML provided)

Initial Comment:
I browse the archives of many mailing lists created by Mailman.

I love its ASCII preformatted display, but many messages to mailing lists are not word-wrapped and so each paragraph appears as a few unreadably long lines.  For example, http://lists.freedesktop.org/archives/xorg/2008-August/038178.html, and resize your browser window wider and narrower.

Modern browsers support the CSS "white-space" property to display long lines wrapped to fit the window, see http://archivist.incutio.com/viewlist/css-discuss/55677

I modified the <pre> tag in that Mailman message to use this CSS style and it now displays fine (in Firefox 3.1a2 and MSIE7 on Windows XP), see http://www.skierpage.com/moz_bugs/pre_wrap_test.html , resize your browser window wider and narrower, and view its source.

This *does not* affect copy and paste of long lines and does not involve processing or changing the text within the pre tag in any way.  It just makes many more messages readable!

The new pre tag is

<pre style="
 white-space: pre-wrap;       /* css-3 should we be so lucky... */
 white-space: -moz-pre-wrap;  /* Mozilla, since 1999 */
 white-space: -pre-wrap;      /* Opera 4-6 ?? */
 white-space: -o-pre-wrap;    /* Opera 7 ?? */
 word-wrap: break-word;       /* Internet Explorer 5.5+ */
 _white-space: pre;   /* IE only hack to re-specify in addition to word-wrap  */
">

Please consider making the change in a future Mailman release.  In appreciation of your consideration I donated $10 to GNU Mailman.

P.S.  In order to pass strict validation, adding a style means you have to specify the HTML 4.01 Transitional DOCTYPE.  I did in my modified file and passes 100%. According to validator.w3.org, the original DOCTYPE in Mailman's HTML output ( <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN"> ) is invalid anyway.

----------------------------------------------------------------------

>Comment By: Mark Sapiro (msapiro)
Date: 2008-08-25 17:32

Message:
Logged In: YES 
user_id=1123998
Originator: NO

Thank you for the suggested style. It looks promising.

It is not clear to me whether you operate a Mailman site or are just a
member of lists, but a site can easily accomplish what you've done by
making site/language versions of the article.html template per
<http://wiki.list.org/x/jYA9> with the following changes:

Change the doctype declaration to

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">

and add the following style in the <head> section

<style type="text/css">
pre
{
  white-space: pre-wrap;       /* css-3 */
  white-space: -moz-pre-wrap;  /* Mozilla, since 1999 */
  white-space: -pre-wrap;      /* Opera 4-6 */
  white-space: -o-pre-wrap;    /* Opera 7 */
  word-wrap: break-word;       /* Internet Explorer 5.5+ */
  _white-space: pre; /* IE only hack to re-specify in addition to
word-wrap */
}
</style>

Of course the browser specific parts of the style don't pass validation at
<http://jigsaw.w3.org/css-validator/> but that's not unexpected. Note
however that the valid style

<style type="text/css">
pre
{
  white-space: pre-wrap;       /* css-3 */
}
</style>

alone appears sufficient in Firefox 3.0.1, Opera 9.51 and Safari 3.1.2,
but not in Camino 1.6.3 or MSIE 7.0 and adding

  white-space: -moz-pre-wrap;

works in Camino.

----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=100103&aid=2074453&group_id=103


More information about the Mailman-coders mailing list