ExpressionEngine CMS
Open, Free, Amazing

Thread

This is an archived forum and the content is probably no longer relevant, but is provided here for posterity.

The active forums are here.

Strip line breaks from fields

July 22, 2007 4:43pm

Subscribe [2]
  • #1 / Jul 22, 2007 4:43pm

    ruraldreams

    279 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?

  • #2 / Jul 24, 2007 1:28pm

    ruraldreams

    279 posts

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

  • #3 / Jul 24, 2007 1:47pm

    Lisa Wess's avatar

    Lisa Wess

    20502 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.

  • #4 / Jul 25, 2007 6:19am

    silenz's avatar

    silenz

    1651 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.

    {exp:strip_lb}
    some text
    
    some more text
     
    even more text
    
    {/exp:strip_lb}

    returns:

    some text
    some more text
    even more text
    
.(JavaScript must be enabled to view this email address)

ExpressionEngine News!

#eecms, #events, #releases