Sha256: e656d175ffb8013aa2afc25e1ec741d9ab8bce14c0fa00908aec830bfd15427c

Contents?: true

Size: 529 Bytes

Versions: 14

Compression:

Stored size: 529 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
        when defined?(Markdown)
          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

14 entries across 14 versions & 1 rubygems

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