Forum: Ruby on Rails Comments for a blog

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
14aabf76f6fb6522b92afeda5ddaaaa3?d=identicon&s=25 Daniel Hernandez (Guest)
on 2006-03-29 04:35
(Received via mailing list)
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
42292bf8a0acbc98862d9306b501275d?d=identicon&s=25 Daniel Waite (rabbitcreative)
on 2006-03-29 04:38
(Received via mailing list)
2c80e1b0837eec76d38d4f7fa1c15e87?d=identicon&s=25 Michael Gorsuch (Guest)
on 2006-03-29 04:39
(Received via mailing list)
I use RedCloth w/ h.

RedCloth.new(h comment).to_html

This will sanitize via h, and then convert textile commands to HTML.
14aabf76f6fb6522b92afeda5ddaaaa3?d=identicon&s=25 Daniel Hernandez (Guest)
on 2006-03-29 04:42
(Received via mailing list)
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.
14aabf76f6fb6522b92afeda5ddaaaa3?d=identicon&s=25 Daniel Hernandez (Guest)
on 2006-03-29 05:00
(Received via mailing list)
On Tue, 28 Mar 2006, Michael Gorsuch 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 <pre> but h sanitize it.
2. I don't like allow some ReCloth's tags like h1.
855c677aca7319a44da19fb583b9f320?d=identicon&s=25 Nicolas Cavigneaux (Guest)
on 2006-03-29 13:24
(Received via mailing list)
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/Help...

Bye.
733b5983d61a6f9c0c7ba59834fdf90f?d=identicon&s=25 Martin Scheffler (Guest)
on 2006-03-29 13:57
This topic is locked and can not be replied to.