Re: Converting newlines to <br /> tags

Bill Ward <[email protected]>
Newsgroups gmane.comp.lang.perl.modules.template-toolkit
Message-ID <CAKGT8WrqOOjhzBzF-fYvb_r_c=Ravd8VR=mXmSvE_3oGbwrR+g@mail.gmail.com>
On Sun, Feb 12, 2012 at 8:05 PM, Richard Thomas <[email protected]> wrote:

> > <td>[% b.affiliations.0 | html || "&nbsp;"  %]</td>
> > or
> > <td>[% (b.affiliations.0 | html) || "&nbsp;"  %]</td>
> > does not work; I get a parse error in both cases.
> >
> > I could just go back to HTML.escape() and in this case I have no need
> for the html_line_break ... but if I ever needed both the &nbsp thing as
> well as the line break thing, how could that be done?
>
> Perhaps something like:
>
>        <td>[% v = b.affiliations.0 | html; v || '&nbsp;' %]</td>
>
>
Yep, that works! Thanks.

-- 
Check out my LEGO blog at http://www.brickpile.com
Follow/friend me: facebook.com/billward • flickr.com/photos/billward •
twitter.com/williamward

_______________________________________________
templates mailing list
[email protected]
http://mail.template-toolkit.org/mailman/listinfo/templates
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.