Class: HoboFields::TextileString

Inherits:
Text
  • Object
show all
Includes:
SanitizeHtml
Defined in:
lib/hobo_fields/textile_string.rb

Constant Summary

Constants included from SanitizeHtml

SanitizeHtml::PERMITTED_ATTRIBUTES, SanitizeHtml::PERMITTED_TAGS

Constants inherited from Text

HoboFields::Text::COLUMN_TYPE, HoboFields::Text::HTML_ESCAPE

Instance Method Summary collapse

Methods included from SanitizeHtml

sanitize

Instance Method Details

#to_html(xmldoctype = true) ⇒ Object



9
10
11
12
13
14
15
16
17
# File 'lib/hobo_fields/textile_string.rb', line 9

def to_html(xmldoctype = true)
  if blank?
    ""
  else
    textilized = RedCloth.new(self, [ :hard_breaks ])
    textilized.hard_breaks = true if textilized.respond_to?("hard_breaks=")
    textilized.to_html
  end
end