From: Chad Fowler Date: 2004-10-20T12:51:10+09:00 Subject: Re: Textile with ERB On Wed, 20 Oct 2004 11:28:42 +0900, Bill Atkins wrote: > I'm trying to use Textile and ERB together for a website I'm > developing. Basically, a sample file looks like: > > --- > > <%= produce_some_output "param" %> > > Here's some *Textile* text. > > --- > > I want the ERB code to be evaluated and I also want the Textile markup > translated into HTML. How can I do this? Right now I'm doing: > > s = File.read "myfile.rhtml" > result = RedCloth.new(ERB.new(s).result).to_html > > The problem is that the produce_some_output function prints out the > opening , , and tags. This is really the problem, right? Who wrote the produce_some_output method? There doesn't appear to be an inherent problem with comingling erb and RedCloth. You would have the same problem if you replaced the call to produce_some_output with embedded , , and tags. Maybe I'm misunderstanding. If you can't change the produce_some_output method to have it stop returning the unwanted HTML tags, then you could hack the HTML tags out with gsub, or (more accurate--more of a pain) use something like the ruby htmltools library to properly parse the output and return only the sub-nodes you want. Yuck. :) Chad