Comments for a blog


#1

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


#2

I like Redcloth:


#3

I use RedCloth w/ h.

RedCloth.new(h comment).to_html

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


#4

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.


#5

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.


#6

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.

#7

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