Class: HoboFields::Types::RawMarkdownString

Inherits:
Text
  • Object
show all
Defined in:
lib/hobo_fields/types/raw_markdown_string.rb

Direct Known Subclasses

MarkdownString

Constant Summary collapse

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

Constants inherited from Text

Text::COLUMN_TYPE

Instance Method Summary collapse

Instance Method Details

#to_html(xmldoctype = true) ⇒ Object



18
19
20
# File 'lib/hobo_fields/types/raw_markdown_string.rb', line 18

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