class HoboFields::Types::TextileString

Public Instance Methods

to_html(xmldoctype = true) click to toggle source
# File lib/hobo_fields/types/textile_string.rb, line 7
def to_html(xmldoctype = true)
  require 'redcloth'

  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