Comments for a blog

Hello,

I’m making a blog and I need some function that convert the text
writed for a user in a textarea into a formated text.
I think to use h, but it forget paragraph breaks and I
like allow some tags.

By
Daniel

I like Redcloth:
http://whytheluckystiff.net/ruby/redcloth/

I use RedCloth w/ h.

RedCloth.new(h comment).to_html

This will sanitize via h, and then convert textile commands to HTML.

On Tue, 28 Mar 2006, Rabbit wrote:

I like Redcloth:
http://whytheluckystiff.net/ruby/redcloth/

But in redcloth a user can insert tags that I don’t want allow.

Le Mercredi 29 Mars 2006 04:34, Daniel Hernandez a écrit :

Hello,

Hello,

I’m making a blog and I need some function that convert the text
writed for a user in a textarea into a formated text.
I think to use h, but it forget paragraph breaks and I
like allow some tags.

You can use simple_format, see :
http://api.rubyonrails.com/classes/ActionView/Helpers/TextHelper.html#M000510

Bye.

On Tue, 28 Mar 2006, Michael G. wrote:

I use RedCloth w/ h.

RedCloth.new(h comment).to_html

This will sanitize via h, and then convert textile commands to HTML.

But it has two problems:

  1. I like allow some tags like
     but h sanitize it.
  2. I don’t like allow some ReCloth’s tags like h1.

I use this: http://blog.ideoplex.com/2005/03/17.html