Why is RedCloth 3.0.4 so borked?

Hello,

I do really like Textile - many people do. This is why I do not understand why the latest version of RedCloth, 3.0.4, does not work as expected - while the 3.0.3 version does. Everywhere you find forum posts or blog posts recommending 3.0.3. So why is there a 3.0.4 version at all? Since more than a year? Do the original authors still care? What is the reason for version 3.0.4 acting so strange? Will there be a version 3.0.5 correcting these issues?

I've also already contacted why (the author), but apparently he doesn't reply - and presumably care - anymore. What is especially sad is that in the SVN there is sitting a neat start of a good refactoring of RedCloth, something that could be a 3.0.5 soon... http://rubyforge.org/projects/redcloth/

Maybe I should adress the authors directly, but I just thought I'd give it a shot on the forums. So I'm looking forward to your replies.

It would be great if it got improved. Actually I thought about doing it myself, but for the coming weeks I'm quite busy finishing my FOSS rails app before Fosdem 2007 in Brussels (end of feb.).

Would be great if we got a community together to fix and release the code from the SVN.

Wybo

Man, I thought it was just me. I filed a couple of bugs against it and didn't see any response. I'll see if I can downgrade to 3.0.3

Does anyone know if the tip revision in svn is in good shape?

I posted something to the project authors and to the mail list for redcloth. I'll update this if I find out anything.

Joe

My understanding is that it isn't borked, they just changed the default handling to something that most people don't expect.

I can't remember where I read this but I know I did see something and I believe there is a config option to get 3.0.3 behavior from 3.0.4, along with whatever else is new/changed/fixed in 3.0.4.

I'd be interested to hear whatever this is if someone knows.

Hunter

I have some fairly basic usages that break it (according to the docs). After some digging it appears that the problem may be between RedCloth and Rails

For example, from the rails console:

@note = @a.notes

=> "h1. this is a heading\n\nand this is not going to be"

RedCloth.new(@note).to_html

=> "<h1>this is a heading</h1>\n\n\n\t<p>and this is not going to be</p>"

The tab character is unexpected, but not strictly speaking a bug because it doesn't change the rendering (maybe it is on purpose for readability in the generated HTML source even)

When I look at the generated HTML source from my rails app I see something different:

   <h1>this is a heading<br /> and this is not going to be</h1>

Hmmm, does rails (edge currently) ship a different version of RedCloth somehow? Or not use RedCloth for "textilize" anymore?

Sorry for the stream-of-thought here. I changed my partial from

<%= textilize @agendaitem.notes %>

to

<%= RedCloth.new(@agendaitem.notes).to_html %>

and it now behaves as expected.

How do I dig into this to find out what is happening? Find the implementation for textilize in my rails version I guess.

You can easily dig into the source: http://dev.rubyonrails.org/browser/trunk/actionpack/lib/action_view/helpers/text_helper.rb#L108

It's also easy enough to overwrite this in your application_helper too, or better yet -- a plugin.