[Solar-talk] retain line breaks/newline

Antti Holvikari anttih at gmail.com
Thu Aug 3 06:02:39 PDT 2006


On 8/3/06, Jeff Surgeson <solar at 3hex.com> wrote:

Hi jeff,

> Still being stupid
>
> <?php echo nl2br($this->escape($this->list['description'])) ?>
>
> works just fine, note to myself, think befor you post!

I had a similar problem where I wanted paragraphs to be inside <p>
tags. Also I was wondering if I should store the text into db as HTML
or not. So what I ended up doing was to use Text_Wiki markup and store
that "as-is" to the db. Then I made a helper to transform that to
XHTML with Text_Wiki. Works *exactly* as I want.

-- 
Antti Holvikari


More information about the solar-talk mailing list