Sha256: 76d0ed06124064280289060dbfc1b2f3eb42e4b7008a841bff75270e794b597e

Contents?: true

Size: 507 Bytes

Versions: 43

Compression:

Stored size: 507 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=")
          HoboFields::SanitizeHtml.sanitize(textilized.to_html)
        end
      end

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

Version data entries

43 entries across 43 versions & 1 rubygems

Version Path
hobo_fields-2.0.1 lib/hobo_fields/types/textile_string.rb
hobo_fields-2.0.0 lib/hobo_fields/types/textile_string.rb
hobo_fields-2.0.0.pre10 lib/hobo_fields/types/textile_string.rb
hobo_fields-2.0.0.pre9 lib/hobo_fields/types/textile_string.rb
hobo_fields-2.0.0.pre8 lib/hobo_fields/types/textile_string.rb
hobo_fields-1.3.3 lib/hobo_fields/types/textile_string.rb
hobo_fields-2.0.0.pre7 lib/hobo_fields/types/textile_string.rb
hobo_fields-2.0.0.pre6 lib/hobo_fields/types/textile_string.rb
hobo_fields-2.0.0.pre5 lib/hobo_fields/types/textile_string.rb
hobo_fields-2.0.0.pre4 lib/hobo_fields/types/textile_string.rb
hobo_fields-1.3.2 lib/hobo_fields/types/textile_string.rb
hobo_fields-1.3.1 lib/hobo_fields/types/textile_string.rb
hobo_fields-2.0.0.pre3 lib/hobo_fields/types/textile_string.rb
hobo_fields-2.0.0.pre2 lib/hobo_fields/types/textile_string.rb
hobo_fields-2.0.0.pre1 lib/hobo_fields/types/textile_string.rb
hobo_fields-1.4.0.pre8 lib/hobo_fields/types/textile_string.rb
hobo_fields-1.4.0.pre7 lib/hobo_fields/types/textile_string.rb
hobo_fields-1.4.0.pre6 lib/hobo_fields/types/textile_string.rb
hobo_fields-1.4.0.pre5 lib/hobo_fields/types/textile_string.rb
hobo_fields-1.4.0.pre4 lib/hobo_fields/types/textile_string.rb