Group of util and formatting methods defined in Wordpress and ported to Ruby.
This gem includes:
- wpautop
Add this line to your application's Gemfile:
gem 'wordpress_util'
And then execute:
$ bundle
Or install it yourself as:
$ gem install wordpress_util
Replaces double line-breaks with paragraph elements.
A group of regex replaces used to identify text formatted with newlines and
replace double line-breaks with HTML paragraph tags. The remaining line-breaks
after conversion become
tags, unless br is set to '0' or 'false'.
WordpressUtil.wpautop("some text")
Bug reports and pull requests are welcome on GitHub at https://github.com/leonardoalifraco/wordpress_util. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the Contributor Covenant code of conduct.
The gem is available as open source under the terms of the MIT License.