RedCloth 4.0 Released: 40x Faster Textile Rendering
RedCloth is a popular Ruby library for converting Textile-formatted text into HTML. Initially developed by WhyTheLuckyStiff, it's now under the guardianship of Jason Garber, who has just released version 4 (RubyForge or Github). This is a significant update, following on from 3.0.4 which was released almost three years ago, and features a handful of significant improvements and changes:
- New SuperRedCloth (RedCloth 4.0) is a total rewrite using Ragel for the parsing.
- Markdown support has been removed.
- Single newlines become <br> tags, just as in traditional RedCloth and other Textile parsers.
- HTML special characters are automatically escaped inside code signatures, like Textile 2. This means you can simply write @<br />@ and the symbols are escaped whereas in RedCloth 3 you had to write @<br />@ to make the code fragment readable.
- HTML embedded in the Textile input does not often need to be escaped from Textile parsing.
- The parser will not wrap lines that begin with a space in paragraph tags.
- Rudimentary support for LaTeX is built in.
- RedCloth::VERSION on a line by itself inserts the version number into the output.
- Output (less newlines and tabs) is identical to Textile 2 except a few cases where the RedCloth way was preferable.
- Over 500 tests prevent regression
- It's 40 times faster than the previous version.
Unless fiddling with the edge version on Github interests you, you can install or update with gem in the usual way - gem install RedCloth, etc.