Sha256: 7c4779e5d287cc493997ea4e9888f8d95ba0b4dca4328fbe2fff04479d59b02f

Contents?: true

Size: 515 Bytes

Versions: 14

Compression:

Stored size: 515 Bytes

Contents

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

      include SanitizeHtml

      def to_html(xmldoctype = true)
        require 'redcloth'

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

      HoboFields.register_type(:textile, self)
    end
  end
end

Version data entries

14 entries across 14 versions & 1 rubygems

Version Path
hobo_fields-2.2.6 lib/hobo_fields/types/textile_string.rb
hobo_fields-2.2.5 lib/hobo_fields/types/textile_string.rb
hobo_fields-2.2.4 lib/hobo_fields/types/textile_string.rb
hobo_fields-2.2.3 lib/hobo_fields/types/textile_string.rb
hobo_fields-2.2.2 lib/hobo_fields/types/textile_string.rb
hobo_fields-2.2.1 lib/hobo_fields/types/textile_string.rb
hobo_fields-2.2.0 lib/hobo_fields/types/textile_string.rb
hobo_fields-2.1.2 lib/hobo_fields/types/textile_string.rb
hobo_fields-2.1.1 lib/hobo_fields/types/textile_string.rb
hobo_fields-2.1.0 lib/hobo_fields/types/textile_string.rb
hobo_fields-2.1.0.pre4 lib/hobo_fields/types/textile_string.rb
hobo_fields-2.1.0.pre3 lib/hobo_fields/types/textile_string.rb
hobo_fields-2.1.0.pre2 lib/hobo_fields/types/textile_string.rb
hobo_fields-2.1.0.pre1 lib/hobo_fields/types/textile_string.rb