allow message display to wrap (simple HTML provided)

Bug #266467 reported by skierpage on 2008-08-26
34
This bug affects 3 people
Affects Status Importance Assigned to Milestone
GNU Mailman
Medium
Mark Sapiro

Bug Description

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.

[http://sourceforge.net/tracker/index.php?func=detail&aid=2074453&group_id=103&atid=100103]

Related branches

Mark Sapiro (msapiro) wrote :

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.

Mark Sapiro (msapiro) wrote :

Fixed in mailman/2.2 at rev 1006

Changed in mailman:
assignee: nobody → msapiro
status: New → Fix Committed
Mark Sapiro (msapiro) wrote :

I added

   <style type="text/css">
       pre {
           white-space: pre-wrap; /* css-2.1, current FF, Opera, Safari */
           }
   </style>

To all the templates/<lang>/article.html templates in the mailman/2.2 branch. This also works for Google Chrome (as expected as it uses the same WebKit engine as Safari), and yes, this is in the CSS 2.1 satndard.

skierpage (skierpage) wrote :

Thanks indeed.

Is there any chance of backporting this to the 2.1 branch? Sites like lists.freedesktop.org still lack it, and I think 2.2 is not released.

Mark Sapiro (msapiro) wrote :

Mailman 2.2 should be the next thing I release. I am not currently planning any further releases of the 2.1 branch.

As noted above, any 2.1 Mailman installation admin can easily make an edited version of the article.html template to fix this for their installation.

Mark Sapiro (msapiro) wrote :

It was an oversight to not apply this fix in 2.1.12. It will be applied to 2.1.13.

Changed in mailman:
milestone: 2.1-stable → 2.1.13
Mark Sapiro (msapiro) on 2009-12-22
Changed in mailman:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers