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-1.4.0.pre3 lib/hobo_fields/types/textile_string.rb
hobo_fields-1.4.0.pre2 lib/hobo_fields/types/textile_string.rb
hobo_fields-1.3.0 lib/hobo_fields/types/textile_string.rb
hobo_fields-1.3.0.RC4 lib/hobo_fields/types/textile_string.rb
hobo_fields-1.3.0.RC3 lib/hobo_fields/types/textile_string.rb
hobo_fields-1.3.0.RC2 lib/hobo_fields/types/textile_string.rb
hobo_fields-1.3.0.RC1 lib/hobo_fields/types/textile_string.rb
hobo_fields-1.3.0.RC lib/hobo_fields/types/textile_string.rb
hobo_fields-1.3.0.pre31 lib/hobo_fields/types/textile_string.rb
hobo_fields-1.3.0.pre29 lib/hobo_fields/types/textile_string.rb
hobo_fields-1.3.0.pre28 lib/hobo_fields/types/textile_string.rb
hobo_fields-1.3.0.pre27 lib/hobo_fields/types/textile_string.rb
hobo_fields-1.3.0.pre26 lib/hobo_fields/types/textile_string.rb
hobo_fields-1.3.0.pre25 lib/hobo_fields/types/textile_string.rb
hobo_fields-1.3.0.pre24 lib/hobo_fields/types/textile_string.rb
hobo_fields-1.3.0.pre23 lib/hobo_fields/types/textile_string.rb
hobo_fields-1.3.0.pre22 lib/hobo_fields/types/textile_string.rb
hobo_fields-1.3.0.pre21 lib/hobo_fields/types/textile_string.rb
hobo_fields-1.3.0.pre20 lib/hobo_fields/types/textile_string.rb
hobo_fields-1.3.0.pre19 lib/hobo_fields/types/textile_string.rb