Issue75

Title Improve wrapping of comment text
Priority bug Status resolved
Superseder Nosy List amk
Assigned To Topics

Created on 2007-01-15.14:48:08 by amk, last changed 2007-01-15.20:16:43 by forsberg.

Messages
msg347 (view) Author: amk Date: 2007-01-15.14:48:07
Long lines containing no newlines aren't wrapped by the conversion process,
resulting in a very wide window.  See
http://psf.upfronthosting.co.za/roundup/tracker/issue1619060 for an example.

Perhaps the algorithm should be:
1) split apart the comment at the newlines.
2) determine the length of the longest line.
3) if it's >100 (or 80, or some slightly-too-long limit), run the comment
   through the textwrap.wrap() function.

You'd have to add some special-case code to avoid rewrapping code 
excerpts.
msg355 (view) Author: forsberg Date: 2007-01-15.18:41:32
> You'd have to add some special-case code to avoid rewrapping code 
> excerpts.

Well, if you have a piece of code that with accuracy can find out
what's code excerpts, I'm happy to use it :-). 

This might also be fixable using CSS. 

\EF
-- 
Erik Forsberg                 http://efod.se
GPG/PGP Key: 1024D/0BAC89D9
msg356 (view) Author: forsberg Date: 2007-01-15.19:55:07
I added a wrap="true" to the <pre> used to display messages. Looks better now,
if you ask me. What do you think?

I failed to do this using css. If I understand
http://www.w3.org/TR/CSS21/text.html#propdef-white-space correctly, a 

table.messages td pre 
{ white-space: pre-wrap } 

..should do the trick, but it doesn't work for some unknown reason.
msg357 (view) Author: roche Date: 2007-01-15.20:04:16
On Mon, 2007-01-15 at 19:55 +0000, Erik Forsberg wrote:
> Erik Forsberg <forsberg@efod.se> added the comment:
> 
> I added a wrap="true" to the <pre> used to display messages. Looks better now,
> if you ask me. What do you think?
> 
> I failed to do this using css. If I understand
> http://www.w3.org/TR/CSS21/text.html#propdef-white-space correctly, a 
> 
> table.messages td pre 
> { white-space: pre-wrap } 

I've been here before. A slight improvement to make it cross browser
compatible:

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+ */
}

See:
http://myy.helia.fi/~karte/pre-wrap-css3-mozilla-opera-ie.html
msg358 (view) Author: forsberg Date: 2007-01-15.20:16:43
Roché Compaan <metatracker@psf.upfronthosting.co.za> writes:

> I've been here before. A slight improvement to make it cross browser
> compatible:

Ah. Thankyou!

The wonderful world of browsers.. 

\EF
-- 
Erik Forsberg                 http://efod.se
GPG/PGP Key: 1024D/0BAC89D9
History
Date User Action Args
2007-01-15 20:16:43forsbergsetmessages: + msg358
2007-01-15 20:04:16rochesetmessages: + msg357
2007-01-15 19:55:07forsbergsetstatus: chatting -> resolved
messages: + msg356
2007-01-15 18:41:32forsbergsetstatus: unread -> chatting
messages: + msg355
2007-01-15 14:48:08amkcreate