From: bdarcus@... Date: 2005-07-20T06:15:55+09:00 Subject: customizing redcloth? Newbie question: How do I add a new inline rule to RedCloth? I want to add support for inline semantic quotes, including support for citation markup. So, I want ``this'':someid#pages=23, to be converted to: this I'm not getting the pattern processed though. I'm thinking it's because RedCloth (and in particular the to_html method) doesn't know about the new method I want to add, but have no idea how to resolve that (or if I'm even right). Bruce #! /usr/bin/env ruby require 'rubygems' require 'redcloth' class RedCloth QUOTE_RE = / ([\s\[{(]|[#{PUNCT}])? # $pre `` # start (#{C}) # $atts ([^"]+?) # $text \s? (?:\(([^)]+?)\)(?="))? # $quote '': (\S+?) # $citeid (\/)? # $slash ([^\w\/;]*?) # $post (?=<|\s|$) /x def inline_textile_quote( text ) text.gsub!( QUOTE_RE ) do |m| pre,atts,text,quote,citeid,slash,post = $~[1..7] # citeid, citeid_quote = check_refs( citeid ) # quote ||= citeid_quote atts = pba( atts ) atts = " cite=\"#{ citeid }\"#{ atts }" text << "#{ quote }" if title atts = shelve( atts ) if atts "#{ pre }#{ text }#{ post }" end end end