# \[ANN\] RedCloth 4.0.0 -- Total rewrite - less buggy - 40x fas

**URL:** <https://www.ruby-forum.com/t/ann-redcloth-4-0-0-total-rewrite-less-buggy-40x-fas/144055>\
**Category:** Ruby\
**Created:** [July 24, 2008, 10:35pm UTC](https://www.ruby-forum.com/t/ann-redcloth-4-0-0-total-rewrite-less-buggy-40x-fas/144055 "2008-07-24T22:35:02Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![jasongarber](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/977dab/32.png) [@jasongarber](https://www.ruby-forum.com/u/jasongarber)\
**Post date:** [July 24, 2008, 10:35pm UTC](https://www.ruby-forum.com/t/ann-redcloth-4-0-0-total-rewrite-less-buggy-40x-fas/144055/1 "2008-07-24T22:35:02Z")

</div>

I sent this message to the list early Tuesday morning, but it never  
showed up. Here’s hoping a post to Ruby Forum fares better…

RedCloth 4.0 is out.

The highlights:

- It brings Ruby Textile processing more in line with Textile 2, so no  
more Markdown support (there are other libraries for that). There are a  
number of new Textile 2 modifiers supported and line breaks behave the  
way they should in Textile. Output (less trivial whitespace) is  
identical to Textile 2 except a few cases where the RedCloth way was  
preferable.
- It’s a C extension, generated with Ragel (the same  
finite-state-machine juice that powers Mongrel and Hpricot), and it’s 40  
times faster than the pure Ruby version was.
- It’s less buggy than the previous version, one would hope, with over  
500 test cases, including all the examples from the Textile 2  
documentation.

To install or update your gems:  
gem install RedCloth

Then choose the native Ruby gem or the Win32 binary gem.

A few notes:

- There may be some confusion about which version of RedCloth your app  
is running if you had RedCloth 3 installed in your project directly, not  
using gems. If the old one is found earlier in your LOAD\_PATH, you’re  
still on RedCloth 3. If in doubt, you can run “RedCloth::VERSION”  
through your app and it should output “

4.0.0

”.
- This is a total rewrite–and a major release at that. The old hacks  
you may have used, both in content (to work around parsing bugs) and in  
use of the library (to add in custom behavior) may not work. We’ve  
tried to make it as backward-compatible as possible, but it may take a  
little adjustment. Such is the price of progress.
- As complex as Textile is, there will probably be many bugs in this  
first version. We’ll handle them and release new versions on a fairly  
short cycle. _Update:_ 4.0.1 was just released to address some small  
bugs reported since 4.0 was released on Monday. See the CHANGELOG for  
details.

Thanks go to Why the Lucky Stiff for starting RedCloth and the rewrite  
and so readily handing the project off when he got involved in Shoes.  
Thanks also to the many people that downloaded the testing gems or  
checked out from GitHub and offered their patches. I also appreciate my  
employer, Eastern Mennonite University, seeing the value in open source  
software and allowing a few hours hacking time a week so they could have  
a Textile-powered CMS that really works.

Jason G.

[http://redcloth.org/](http://redcloth.org/)  
[http://rubyforge.org/projects/redcloth/](http://rubyforge.org/projects/redcloth/)

> **[Commits · jgarber/redcloth](https://github.com/jgarber/redcloth/commits/RELEASE_4_0_0)**
>
> RedCloth is a Ruby library for converting Textile into HTML. - Commits · jgarber/redcloth

[http://jgarber.lighthouseapp.com/projects/13054-redcloth](http://jgarber.lighthouseapp.com/projects/13054-redcloth)

---

<div class="post-metadata">

**Author:** ![jasongarber](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/977dab/32.png) [@jasongarber](https://www.ruby-forum.com/u/jasongarber)\
**Post date:** [July 25, 2008, 12:34am UTC](https://www.ruby-forum.com/t/ann-redcloth-4-0-0-total-rewrite-less-buggy-40x-fas/144055/2 "2008-07-25T00:34:23Z")

</div>

Jason G. wrote:

> I sent this message to the list early Tuesday morning, but it never  
> showed up. Here’s hoping a post to Ruby Forum fares better…
> 
> RedCloth 4.0 is out.  
> …
> 
> - It’s a C extension, generated with Ragel (the same  
> finite-state-machine juice that powers Mongrel and Hpricot), and it’s 40  
> times faster than the pure Ruby version was.

This is new, right? So with the addition of a C extension, I guess this  
won’t work under JRuby until we get the Ragel bits converted. For those  
using RedCloth under JRuby, feel free to contact us about getting  
RedCloth 4.0 running, or stick to 3.0 for the time being.

(FYI, we’ve already had a couple reports about RedCloth 4.0 not  
working).

- Charlie

---

<div class="post-metadata">

**Author:** ![jasongarber](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/977dab/32.png) [@jasongarber](https://www.ruby-forum.com/u/jasongarber)\
**Post date:** [July 25, 2008, 1:24am UTC](https://www.ruby-forum.com/t/ann-redcloth-4-0-0-total-rewrite-less-buggy-40x-fas/144055/3 "2008-07-25T01:24:18Z")

</div>

Jason G. wrote:

> I sent this message to the list early Tuesday morning, but it never  
> showed up. Here’s hoping a post to Ruby Forum fares better…
> 
> - It’s a C extension, generated with Ragel (the same  
> finite-state-machine juice that powers Mongrel and Hpricot), and it’s 40  
> times faster than the pure Ruby version was.

Thanks for doing that. I’ve been using the SVN version of this for  
awhile and it cuts my rendering time for textile blocks from like 0.08  
to 0.02. Nice work. Hope it kills all those nasty bugs 3.0.4 had, too.

-R

---

<div class="post-metadata">

**Author:** ![jasongarber](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/977dab/32.png) [@jasongarber](https://www.ruby-forum.com/u/jasongarber)\
**Post date:** [July 25, 2008, 5:15pm UTC](https://www.ruby-forum.com/t/ann-redcloth-4-0-0-total-rewrite-less-buggy-40x-fas/144055/4 "2008-07-25T17:15:36Z")

</div>

Correct. The Ragel bits shouldn’t be too hard to convert from C to  
Java. My concern is how to keep it DRY. Feel free to fork and  
restructure.

Charles Oliver N. wrote:

> This is new, right? So with the addition of a C extension, I guess this  
> won’t work under JRuby until we get the Ragel bits converted. For those  
> using RedCloth under JRuby, feel free to contact us about getting  
> RedCloth 4.0 running, or stick to 3.0 for the time being.
> 
> (FYI, we’ve already had a couple reports about RedCloth 4.0 not  
> working).
> 
> - Charlie
