FUDforum
Fast Uncompromising Discussions. FUDforum will get your users talking.

Home » FUDforum » How To » Controlling Word-Wrapping on Piped Email
Show: Today's Messages :: Unread Messages :: Show Polls :: Message Navigator
| Subscribe to topic | Bookmark topic 
Switch to threaded view of this topic Create a new topic Submit Reply
Controlling Word-Wrapping on Piped Email [message #162831] Thu, 29 July 2010 16:57 Go to next message
wittrs is currently offline  wittrs   United States
Messages: 134
Registered: August 2009
Karma: 0
Senior Member
add to buddy list
ignore all messages by this user
I have an email group that pipes emails to a message board. The word wrap of the emails varies. In yahoo, the messages tend to fill the entire container on the message board. But in all other mail clients, only part of the container width is filled, because the original mail was wrapped. I want all of the email messages to fill the entire width of the container. The word-wrap feature in Global Settings will not accomplish this. I've turned it up, down and off -- there is no change.

I've thought of two possible solutions: a CSS insert, or a Regex that eliminates line breaks. Because I am only a garage mechanic (at these sorts of things), I simply cannot get the job done. Could any of you give me any sorts of leads as to how I might accomplish this?

Here is a link that shows the issue: http://seanwilson.org/forum/index.php?t=msg&th=1729&start=0&S=1 71399e41f2c10c4357dd9b217caaa3f
(compare the message of "sean" with that of "rob." One fills the container, the other not).

Can any of you suggest how to get all the mail to fill the container?

Much thanks in advance(as always).
Re: Controlling Word-Wrapping on Piped Email [message #162832 is a reply to message #162831] Thu, 29 July 2010 19:25 Go to previous messageGo to next message
wittrs is currently offline  wittrs   United States
Messages: 134
Registered: August 2009
Karma: 0
Senior Member
add to buddy list
ignore all messages by this user
Just want to let people know that there is preliminary success using this regex expression:

$string = preg_replace('/(?<!\r|\n)\r?\n(?!\r|\n)/',' ',$string);

It has the desired effect of making all the messages fill in the container. The only problem is that it butchers the signature. The Regex looks for a single line (as opposed to a double carriage return). The premise is that new paragraphs involve two line breaks. You just stick this (?<!\r|\n)\r?\n(?!\r|\n) in the body mangling part of the control panel.
Re: Controlling Word-Wrapping on Piped Email [message #162833 is a reply to message #162831] Thu, 29 July 2010 20:55 Go to previous message
wittrs is currently offline  wittrs   United States
Messages: 134
Registered: August 2009
Karma: 0
Senior Member
add to buddy list
ignore all messages by this user
Here is a regex string that works better. Just stick this in the administrative control panel where you have the maillist rules.

replace mask: '/([^\r\n]{50,})\r?\n(?!\r|\n)/'

replace with: "$1 "

(include a space after the 1.)

This allows you to eliminate word wrapping from incoming emails for lines 50 characters or more, by killing off the line breaks. If under 50, the line breaks stay put. This allows signature lines to be preserved (in practice) while allowing message bodies to fill up the container. I obviously did not write this. A dude on another list did. Just passing it along. Preliminary tests show it is doing the trick. The 50-character benchmark is, of course, not perfect. An intentional single-line break of a short sentence will defeat it, as will an extremely long signature line. But in practice it seems to do the job just fine.
Quick Reply
Formatting Tools:   
  Switch to threaded view of this topic Create a new topic
Previous Topic: Can you wrap text around an image? (RESOLVED)
Next Topic: Hits to non-existent pages
Goto Forum:
  

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ]

Current Time: Sun Oct 22 09:54:05 EDT 2017

Total time taken to generate the page: 0.00510 seconds