Project

textilize

0.01
No commit activity in last 3 years
No release in over 3 years
Gem containing the textilize and textilize_without_paragraph methods removed from Rails without C Extensions.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
2026
 Dependencies

Development

>= 0
 Project Readme

Textilize

As of version 3, Rails doesn't have the textilize and textilize_without_paragraph helper methods. Textilize is a gem brings back the missing method for Rails 3, and it includes the library RedCloth 3.0.4 (newest is at 4.X), which doesn't need to be compiled on server.

The reason we need this gem is that we use :textilize at a few places in our apps, and we don't need super fast RedCloth, we just need a working version that don't force us to install C extensions on various production servers. This could be useful for bundle-package usage, where you can rely on the bundle/cache gems.

BTW, Textilize is not always the top choice, there are some useful gems that are doing it great, but they will requires C extension due to higher version of RedCloth dependency:

https://github.com/dtrasbo/formatize/

https://github.com/rohit/prarupa

Installation

Put gem 'textilize' into your Gemfile and do a bundle install, and that's it.

Usage

The textilize & textilize_without_paragraph helper methods

textilize("I _love_ ROR(Ruby on Rails)!")
# => "<p>I <em>love</em> <acronym title="Ruby on Rails">ROR</acronym>!</p>"

textilize_without_paragraph("I _love_ ROR(Ruby on Rails)!")
# => "I <em>love</em> <acronym title="Ruby on Rails">ROR</acronym>!"

Test

rake test

Credits

whytheluckystiff: RedCloth library

David Heinemeier Hansson: the text helper.

Copyright & Licensing

Copyright (c) 2012 Kudelabs

Released under the MIT License. See LICENSE for details.