EllisLab text mark
Advanced Search
Strip line breaks from fields
Posted: 22 July 2007 04:43 PM
Joined: 2005-08-05
336 posts

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?

Posted: 24 July 2007 01:28 PM   [ # 1 ]   [ Rating: 0 ]
Joined: 2005-08-05
336 posts

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

Posted: 24 July 2007 01:47 PM   [ # 2 ]   [ Rating: 0 ]
Joined: 2004-05-14
20503 posts

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.

Posted: 25 July 2007 06:19 AM   [ # 3 ]   [ Rating: 0 ]
Joined: 2006-10-22
1643 posts

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.

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


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

utilitEEs - Addons for EE