Strip line breaks from fields
Posted: 22 July 2007 02:43 PM   [ Ignore ]  
Research Assistant
RankRankRank
Total Posts:  380
Joined  08-05-2005

I’m feeding some weblog fields into a JavaScript template.  One of my fields is a textarea and the text is being published with line breaks.  The line breaks are breaking the script.

These aren’t
tags that I’m talking about.  I’ve set formatting to ‘none’ on this field.

Is there a plugin (or other solution) that can strip line breaks?

Profile
 
 
Posted: 24 July 2007 11:28 AM   [ Ignore ]   [ # 1 ]  
Research Assistant
RankRankRank
Total Posts:  380
Joined  08-05-2005

I’m still looking for a solution to this, if anyone has one.

Profile
 
 
Posted: 24 July 2007 11:47 AM   [ Ignore ]   [ # 2 ]  
Administrator
Avatar
RankRankRankRankRankRankRank
Total Posts:  26056
Joined  05-14-2004

Are they p tags? I think you need to find out what they are. You might also search for silenz’s TruncHTML plugin, as that might help -but you’ll need to figure out what you’re truncating first.

 Signature 
Profile
MSG
 
 
Posted: 25 July 2007 04:19 AM   [ Ignore ]   [ # 3 ]  
Lab Technician
Avatar
RankRankRankRank
Total Posts:  1866
Joined  10-22-2006

I’d rather think we are talking just about newlines, carriage returns. That kind of stuff.
The text is supposed to be returned on one long line.

Perhaps try this plugin. It simply strips any “\r\n”, “\n” &  “\r” from the given text.

{exp:strip_lb}
some text
<br />
some more text<br /> 
even more text<br />
{/exp:strip_lb} 

returns:

some text<br />some more text<br />even more text<br /> 
 Signature 

utilitEEs - Addons for EE

Profile