Sha256: c284321766e198b1092fbb429209fee10f3439a9e8dbb876bf25b22bff325e93

Contents?: true

Size: 510 Bytes

Versions: 5

Compression:

Stored size: 510 Bytes

Contents

module HoboFields
  module Types
    class RawMarkdownString < HoboFields::Types::Text

      @@markdown_class = case
        when defined?(RDiscount)
          RDiscount
        when defined?(Kramdown)
          Kramdown::Document
        when defined?(Maruku)
          Maruku
        else
          Markdown
        end

      HoboFields.register_type(:raw_markdown, self)

      def to_html(xmldoctype = true)
        blank? ? "" : @@markdown_class.new(self).to_html.html_safe
      end

    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
hobo_fields-2.0.1 lib/hobo_fields/types/raw_markdown_string.rb
hobo_fields-2.0.0 lib/hobo_fields/types/raw_markdown_string.rb
hobo_fields-2.0.0.pre10 lib/hobo_fields/types/raw_markdown_string.rb
hobo_fields-2.0.0.pre9 lib/hobo_fields/types/raw_markdown_string.rb
hobo_fields-2.0.0.pre8 lib/hobo_fields/types/raw_markdown_string.rb