Is there a way to limit Textile parsing? Textile is great, but I don''t want users leaving comments with the ability to add tables and so forth. Is there a way to limit what gets parsed? I''ve tried searching for a way to do this, but with not much luck. I have no fear of diving in and getting my hard dirty, but I''m new to Ruby and to Rails and am just having a hard time finding the right direction to go in. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk -~----------~----~----~----~------~----~------~--~---
On 9/3/06, Dylan Bennett <mboffin-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> > Is there a way to limit Textile parsing? Textile is great, but I don''t > want users leaving comments with the ability to add tables and so > forth. Is there a way to limit what gets parsed? I''ve tried searching > for a way to do this, but with not much luck. > > I have no fear of diving in and getting my hard dirty, but I''m new to > Ruby and to Rails and am just having a hard time finding the right > direction to go in.http://redcloth.rubyforge.org/rdoc/ Look at RedCloth.new and Redcloth#to_html -- Rick Olson http://weblog.techno-weenie.net http://mephistoblog.com --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk -~----------~----~----~----~------~----~------~--~---
On Sun, Sep 03, 2006, Dylan Bennett wrote:> Is there a way to limit Textile parsing? Textile is great, but I don''t > want users leaving comments with the ability to add tables and so > forth. Is there a way to limit what gets parsed? I''ve tried searching > for a way to do this, but with not much luck.You can put the RedCloth parser into "lite mode" which disables block-level elements: RedCloth.new( textile_str, [:lite_mode] ).to_html Check out the docs at http://redcloth.rubyforge.org for more. Ben --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk -~----------~----~----~----~------~----~------~--~---
Thanks, Ben and Rick. I found what I need, which are the rules for the to_html method. I found that I could simply not include one of the rules to determine what did or did not get processed. However, I did run into one hitch, which was the glyphs processing rule. Fortunately, RedCloth is open source and I was able to look in the source to find out what the problem was. It turns out the RedCloth documentation is out of date. Also, fortunately, there''s a wiki entry on the rubyonrails.org site for RedCloth, so I was able to add the data to the wiki about the problem (until they update the official documentation) so others don''t get stuck. Thanks again for the help! --Dylan --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk -~----------~----~----~----~------~----~------~--~---