From: Tom Counsell Date: 2005-07-21T00:20:46+09:00 Subject: Re: customizing redcloth? Hi Bruce On 20 Jul 2005, at 11:50, bdarcus@gmail.com wrote: > Thanks Tom. Tied b, but no luck. I'll need to see if something's > wrong > with my method. Your syntax looks fairly close to other textile syntax (quotes,links) so I'd watch out that Redcloth hasn't already mangled the text before it gets to your regexp. In particular, Redcloth replaces certain bits of the text with codes (e.g. <1>,<2>) as it goes along. Try using to_html(:inline_textile_quote) so that your rule is the only rule. If it works then, then you need to play with the order the rules get executed. > That aside, is there some way for me to do a or c without touching the > redcloth.rb source? The way I ended up doing it, was by overriding to_html in my subclass so that I had complete control over the rule execution order: class WikiRedCloth < RedCloth RULES = [:refs_soks_bracketed_link, :refs_textile, :block_textile_table, :block_ textile_lists,:block_textile_prefix, :inline_textile_image, :inline_text ile_link, :inline_textile_code, :inline_soks, :inline_textile_glyphs, :i nline_textile_span, :refs_markdown, :block_markdown_setext, :block_markd own_atx, :block_markdown_rule, :block_markdown_bq, :block_markdown_lists , :inline_markdown_reflink, :inline_markdown_link ] def to_html super( *RULES ) end # All the def inline_soks declarations etc end (full code halfway down http://rubyforge.org/cgi-bin/viewcvs.cgi/soks/ lib/soks-view.rb?rev=1.40&cvsroot=soks&content-type=text/vnd.viewcvs- markup ) Hope that helps Tom