Yet another attempt to rewrite RedCloth, which is a Textile parser for Ruby. When finished, it will become RedCloth 5.0.
Historically, the RedCloth gem was case-sensitive. gem install redcloth
or including gem 'redcloth'
in your Gemfile would result in an error. Now, either case works.
Textile has always defined line breaks to indicate an HTML BR tag, such as in an address or a poem. RedCloth 3 (c. 2004) integrated Markdown formatting, which ignores line breaks, and then RedCloth 4 (c. 2008) removed Markdown and deprecated the hard_breaks
option. RedCloth 5 has removed the option entirely.
Ignoring line breaks is not part of the Textile spec. If your document has extraneous line breaks, it must not be Textile. RedCloth 3 and 4 can still parse markup that was intended for them. If you need features or bug fixes from RedCloth 5, consider “upgrading” your input text.
A LaTeX formatter used to be included with RedCloth. It is not anymore, but creating a redcloth-latex gem that defines the formatter class wouldn’t be difficult. If you do so, I’ll feature your gem here.
Jason Garber is a Ruby developer in Philadelphia. He has been developing in Ruby since 2005 and has been the official maintainer of RedCloth since 2008.
The author would like to thank all the contributors to RedCloth over the years, but in particular:
- Why the Lucky Stiff (original author, 2003)
- Bil Kleb (LaTeX formatter, 2009)
- Ola Bini (JRuby compatibility, 2008)
- Lucas Carlson (2006)
See LICENSE.