Getting HTML fragments out of a db and rendering them.

1 view
Skip to first unread message

TylerWeir

unread,
Feb 18, 2008, 6:06:46 PM2/18/08
to liftweb
Hey everyone,

I have the description portion of an RSS feed stored in a DB and when
I kick it to the screen, it's encoded such that <p> becomes
&lt;p&gt;.

I'd like it to get on the screen rendered as html.

I'm grabbing the DB record and flatmapping it like in most examples.

Anybody know how to accomplish this?

Thanks,
Ty

David Pollak

unread,
Feb 18, 2008, 6:26:01 PM2/18/08
to lif...@googlegroups.com
Tyler,

I'd do something like:

RSS.findAll.map(rss => <li>{Unparsed(rss.description)}</li>)

scala.xml.Unparsed is kinda dangerous for distributing unvalidated code
(e.g., it's a nice way for cross site scription stuff to creep in.)

Thanks,

David

TylerWeir

unread,
Feb 18, 2008, 6:44:52 PM2/18/08
to liftweb
Dave, once again, thanks.

I'll use this until I find a smarter way.
Reply all
Reply to author
Forward
0 new messages