HtmlTerminator

Build Status

Visits Active Record fields and terminates unsafe HTML.

Installation

Add this line to your application's Gemfile:

gem 'html_terminator'

And then execute:

$ bundle

Or install it yourself as:

$ gem install html_terminator

Usage

In your Rails models:

terminate_html :field1, :field2, :field3

Options

Out of the box, HTML Terminator will strip out ALL html. You can pass in specific elements you want to preserve like this:

terminate_html :field1, :elements => ["b", "i", "em"]
terminate_html :field2, :elements => ["br"]
terminate_html :field3, :elements => ["em"]

Learn more about configuration options Here

Contributing

  1. Fork it
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create new Pull Request