Page 1 of 1

@strip_tags & nl2br plugin

Posted: Sun Nov 16, 2008 5:45 am
by Don Chambers
Here is my entry body created using the html editor:

<strong>Paragraph 1</strong>

<i>Paragraph 2</i>

<p>Paragraph 4</p>

1) I have am using the nl2br plugin, expecting it to insert <br />'s after each sentence and blank line above.
2) I need to strip all possible tags from the entry body.
3) I strip the entry body as follows: {$entry.body|@strip_tags|@strip}

Turns out this strip tags code actually removed the effects of the nl2br plugin. How can I strip the actual entry body tags without removing the markup added by the nl2br plugin?

Re: @strip_tags & nl2br plugin

Posted: Mon Nov 17, 2008 1:18 pm
by garvinhicking
Hi!

Try {$entry.body|@strip_tags:'br'} instead. This allows to leave <br> intact.

Or disable the nl2br plugin and use {$entry.body|@strip_tags|@strip:'<br />'} or {$entry.body|@strip_tags|nl2br}.

Regards,
Garvin