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 use RedCloth w/ h. RedCloth.new(h comment).to_html This will sanitize via h, and then convert textile commands to HTML. On 3/28/06, Daniel Hernandez <dhernand@dcc.uchile.cl> wrote:> 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 > _______________________________________________ > Rails mailing list > Rails@lists.rubyonrails.org > http://lists.rubyonrails.org/mailman/listinfo/rails >
I like Redcloth: http://whytheluckystiff.net/ruby/redcloth/ On 3/28/06, Daniel Hernandez <dhernand@dcc.uchile.cl> wrote:> > 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 > _______________________________________________ > Rails mailing list > Rails@lists.rubyonrails.org > http://lists.rubyonrails.org/mailman/listinfo/rails >-------------- next part -------------- An HTML attachment was scrubbed... URL: http://wrath.rubyonrails.org/pipermail/rails/attachments/20060329/acb79953/attachment.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.
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.
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. -- Nicolas Cavigneaux | GPG keyID : CFE76D24 nico@bounga.org | http://www.bounga.org -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 191 bytes Desc: not available Url : http://wrath.rubyonrails.org/pipermail/rails/attachments/20060329/61168165/attachment.bin