From: Ingo Weiss Date: 2007-02-19T09:51:22+09:00 Subject: Re: Add custom rules to redcloth/textile how? > I was merely pointing to it because I think it would benefit you and > as the current guy-in-charge of it I'm trying to spread knowledge of > it's existence to those who might find it useful. Oh I see! Sorry for the confusion, and thanks again. Following your hints I got it working! Below is my code in case this is useful for someone struggling with the same problem. Beware, the regex is probably VERY naive! :-) Ingo class CustomRedCloth < RedCloth RULES = [:inline_textile_geo, :inline_textile_span, :inline_textile_link, :block_textile_lists, :block_textile_prefix ] # render 'geo' microformat (abbr pattern) def inline_textile_geo( text ) # this: "content":-71.34534/22.34760 text.gsub!( /"([^"]+)":(-?\d+\.\d+)\/(-?\d+\.\d+)/ ) do |m| content,lat,lng = $~[1..3] # becomes this: content "#{content}" end end def to_html super(*RULES) end end -- Posted via http://www.ruby-forum.com/.