Sha256: b30aa1b918fe1eb259ac15fc309042abd90ddc10ef22ffe903724ec6af24865f

Contents?: true

Size: 394 Bytes

Versions: 4

Compression:

Stored size: 394 Bytes

Contents

require 'redcloth'

module HoboFields

  class TextileString < HoboFields::Text

    def to_html(xmldoctype = true)
      if blank?
        ""
      else
        textilized = RedCloth.new(self, [ :hard_breaks ])
        textilized.hard_breaks = true if textilized.respond_to?("hard_breaks=")
        textilized.to_html
      end
    end

    HoboFields.register_type(:textile, self)
  end

end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
hobofields-0.8.1 lib/hobo_fields/textile_string.rb
hobofields-0.8.2 lib/hobo_fields/textile_string.rb
hobofields-0.8.3 lib/hobo_fields/textile_string.rb
hobofields-0.8 lib/hobo_fields/textile_string.rb