Sha256: c3f460f56eb294bc118e705090bdb6c9942f2c6c1c7c6c978970efd3b374eace

Contents?: true

Size: 472 Bytes

Versions: 5

Compression:

Stored size: 472 Bytes

Contents

require 'redcloth'

module HoboFields
  module Types
    class TextileString < HoboFields::Types::Text

      include SanitizeHtml

      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
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
hobo_fields-1.3.0.pre14 lib/hobo_fields/types/textile_string.rb
hobo_fields-1.3.0.pre13 lib/hobo_fields/types/textile_string.rb
hobo_fields-1.3.0.pre12 lib/hobo_fields/types/textile_string.rb
hobo_fields-1.3.0.pre11 lib/hobo_fields/types/textile_string.rb
hobo_fields-1.3.0.pre10 lib/hobo_fields/types/textile_string.rb