[rt-users] here is a quick fix for RTFM not breaking lines when displaying long text field.

AJ me at musefoundry.com
Fri Nov 14 01:35:30 EST 2003


The problem is that the display is an html page.  When you look at the
source, you see the newlines but the fact is that HTML doesn't see \r or \n
as newlines. So here is a little code hack that seems to be working for me.

 

Original Code in RTFM/Article/Elements/ShowCustomFields starting at line 29:

%       if ($cf->Type =~ /^(FreeForm|Text)/) {

%           $content = "<pre>".$content."</pre>" unless ($content =~
/<(.{1,5})>/);

%       }

 

Here is the modified code.  One line that replaces newlines with html
breaks.

 

%       if ($cf->Type =~ /^(FreeForm|Text)/) {

%           $content=~s/(\r|\n)/\<br\>/g;  #This replaces newlines with html
breaks for display

%           $content = "<pre>".$content."</pre>" unless ($content =~
/<(.{1,5})>/);

%       }

 

Hope this helps.

 

A.J.

 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.bestpractical.com/pipermail/rt-users/attachments/20031114/f1332bf7/attachment.htm>


More information about the rt-users mailing list